473,386 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

psql won't connect, though other clients are OK

Hello -
I'm running PG 8.1 on Windows XP.
I've installed the server to run as a service.

The psql command fails to connect to the server, although I can connect with other clients.

When I enter psql -d mydb -h localhost -U admin
I get the following response:
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?


However, with the following steps I can prove that the server is indeed running on localhost and listening on 5432.

First, I run pgAdmin3 and connect to the server. The properties panel shows me that I'm connected to the server via localhost port 5432.
Next, with pgAdmin3 running, I do a netstat and get the following result:

TCP jma:1500 localhost:5432 ESTABLISHED
TCP jma:1502 localhost:5432 ESTABLISHED
TCP jma:5432 localhost:1500 ESTABLISHED
TCP jma:5432 localhost:1502 ESTABLISHED

But if I now run psql, I get the same error message as before.

My postgresql.conf file has the following line:
listen_addresses = 'localhost'
I also tried changed 'localhost' to '*', but the result was the same.

If I leave off the -h option on the psql command, the message is a little different. It says (in part):
... Is the server running on host "???" ...

I've searched the threads in this forum for psql problems and found a few. But not exactly this one.

Can anyone tell me why psql won't connect?
May 16 '07 #1
3 3968
michaelb
534 Expert 512MB
We may need to look at postgresql.conf and pg_hba.conf, but before we get to it, are you running a firewall on this computer?
If yes, could you try to disable it for a minute and run psql again?
May 17 '07 #2
Thank you. It was my Zone Alarm firewall. I turned it off, and it worked.

I originally thought that the firewall was not the problem, because it was letting the other clients connect.

Strange thing though --- when I turned ZA back on, it let psql run. I found that it had created a rule saying psql was OK. bizarre.
May 22 '07 #3
michaelb
534 Expert 512MB
Yes, ZoneAlarm can be tricky. If I remember correctly there could be different ways to allow your programs to work, you can open the specific port#, or you can designate a certain app as trusted... Anyway, the good thing is you got it working!
May 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Phil Campaigne | last post by:
Hi All, Took a break from developing on pgsql 7.3 to set up network printing where I added another host(localhost 193.168.1.2) in red hat network settings. Later, I could start postmaster but...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
4
by: Phil Campaigne | last post by:
Hi All, I just installed postgresql 7.3.4 as an upgrade to 7.3.2 and all went well untill I tried to log into a database that I successfully created. Here are the steps in question: bash-2.05b$...
4
by: Brendan Jurd | last post by:
Hello all, I just wanted to pass on some information about compatibility between the psql client and the postgres server. On a particular network, my workstation and the server are both debian...
7
by: Mike McGavin | last post by:
Hi everyone. I'm searching for a quick and dirty way to have psql record the SQL statements that I enter, especially those related to the database structure. My main motivation is to help...
33
by: John Sidney-Woollett | last post by:
With the advent of postgres v8, would it be possible to change the default behaviour of psql from AUTOCOMMIT=ON to AUTOCOMMIT=OFF ? Although this might break backward compatibility, it might be...
2
by: Patrick Hatcher | last post by:
Just installed and started Pg8.0 beta 2 When I tried to connect via psql, I received an error message: $ psql -Upostgres template1 psql: relocation error: psql: undefined symbol:...
4
by: Jim Seymour | last post by:
Hi, Environment: SunOS 5.7 Generic_106541-29 sun4u sparc SUNW,UltraSPARC-IIi-Engine Postgresql-7.4.6 Build config: --with-java --enable-thread-safety gcc version 3.3.1 less-381 readline-4.3
1
by: mrflibble | last post by:
I've got a postgres db running on a windows mc. I've set it up to accept remote connections. Can I use psql from another machine (*nix) to connect to it? I've tried this: psql MYDB -U postgres -h...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.