Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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

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

share|improve this answer
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

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.

share|improve this answer

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

share|improve this answer
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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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