My pghba.conf had an hostssl entry when SSL was not configured so while @dezso's SELECT. Statement was showing that postgres had re-read the config file none of my changes in pghba.conf were being picked up until I removed the hostssl entries. A default pghba.conf file is installed when the data directory is initialized by initdb. It is possible to place the authentication configuration file elsewhere, however; see the hbafile configuration parameter. The general format of the pghba.conf file is a set of records, one per line.
On Ubuntu 12.04, I've installed pg and pgadmin.
I can access localhost/phppgadmin using the browser.
I also can do this: IP/phppgadmin.
However, I cannot use the IP number to connect to pg using pgadmin.
It reports that the server isn't listening.
Any ideas on this?
3 Answers
PostgreSQL by default listen only on local UNIX sockect. To enable TCP/IP endpoint uncomment in your postgresql.conf file:
listen_addresses = '*'
Where '*' - listen on all interfaces. Or put your IP number here if you want listen on specific IP only.
What's the error message you get from PGAdmin? Is there anything in the logs (/var/log/postgresql.log
or similar)?
I would guess you have no proper auth-setting in your pg_hba.conf
, as PostgreSQL per default only allows local users via unix-sockets to connect, not via TCP which you want. You might need something like
or
in the pg_hba.conf
-- read the above link for proper documentation :)
![Pg_hba Hostssl Ip Pg_hba Hostssl Ip](https://i.stack.imgur.com/2OXOv.png)
Thank you to the different users who helped me narrow down the problem. Actually there were multiple issues. I have outline them here as a complete answer and hope someone else may benefit.
like RJS said, I had to put the listen_addresses to accept multiple IPs. This was initially done but later on I realised that the line had a # in front of it which meant it was commented. So I took off the comment.
Even after stopping the PG server,
pg_lsclusters
showed that there was still a service running. So I couldn't restart it since it reported that it was already running.Then by using
ps
I found that a related program known aspgpool
was using the same port and it wouldn't let the default 5432 port to be used by PG. So I stopped this from the terminal usingsudo pgpool stop
.Then I restarted the postgres server and all was fine!
While searching for an answer, I was told by a volunteer RhodiumToad on IRC (#postgresql) that pooling wasn't necessary for what I was doing. I was asked why I have it. The strange thing is that I never installed it. Perhaps pgpool was installed as some addition.
One of the other problems was that I could not get pgadmin to start up on Windows. and correctly connect. There was a libpq.dll missing. Apparently (you'll find another post on stackoverflow about this), the file was there in a few places on Win XP. So I copied all of the postgres DLL files to Windows/System32 and it fixed that.
That's it! Hope this helps.