I got a tiny problem regarding connection to my server. What should we do when this message appears in front of you?

enter image description here

I've done several changes in the pg_hba.conf entry but yet to succeed. Any careless mistake from my side?

  • 1
    Migrate this to SuperUser? – Sean Aug 12 '11 at 12:41
  • 1
    @zearth are you intending to use postgis with postgres - if yes it is a GIS related question. – Mapperz Aug 12 '11 at 13:50
  • @Mapperz Of course. – zearth Aug 16 '11 at 2:02

Assuming you network is secure:

# Allow a user from host to connect to database
# "postgres" if the user's password is correctly supplied.
host    postgres    all          md5


  • 1
    With that format, an IP-mask must follow the IP-ADDRESS. Or you could just use a single CIDR-address of – Mike T Aug 12 '11 at 3:16

If you make any changes to the configuration files (most notably pg_hba.conf), you need to signal the database server to reload. If your database server is on a Windows computer, this is likely in the start menu:

Start > PostgreSQL 9.0 > Reload Configuration

or if it is on a POSIX system (Linux, Mac OS X, etc.), the direct way is with pg_ctl reload [-s] [-D datadir], or some other convenient service wrapper, e.g. if you install via YUM from http://www.pgrpms.org/:

service postgresql-9.0 reload

The result from either Windows or POSIX reload should show a helpful message, like:

server signaled

If there are problems with your pg_hba.conf file, they should appear here.


Besides the pg_hba.conf settings, you may want to look at listen_addresses from your postgresql.conf file.


  • 2
    but the message above shows that the database is listening to (and rejecting) connections – Mike T Aug 12 '11 at 8:56
  • start using the "trust" method which should allow you to connect no matter what and then work your way up. Can you connect locally with host all all trust ? – Ragi Yaser Burhum Aug 12 '11 at 16:58

I went through similar problem. I was able to fix it by editing the pg_hba.config file and adding another entry immediately after the default one for the remote machine ipaddress range. I basically copied the default one and just changed the database, user, CIDR-ADDRESS and METHOD information. I reloaded the config file from start menu (start/postgres x.x/reload configuration). This solved my problem. like this:

IPv4 local connections:

host all all *.0.0.*/32 trust (default one)

IPv4 local connections:

host zigag gisuser trust

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.