Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

Thanks in advance. I love this sentence.

Migrate this to SuperUser? –  Sean Aug 12 '11 at 12:41
@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

4 Answers 4

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


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.


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


This site is currently not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .