tags:

views:

46

answers:

1

I've got a PostgreSQL data base that I'd like to configure to accept all incoming connections regardless of the source IP address. How can this be configured in the pg_hba.conf file? I'm using postgreSQL version 8.4.

+3  A: 

Just use 0.0.0.0/0:

host    all             all             0.0.0.0/0            md5

Make sure the listen_addresses in postgresql.conf allows all incoming connections as well:

listen_addresses = '*'

After the changes you have to reload the configuration (as a superuser):

SELECT pg_reload_conf();
Frank Heikens
does this really work with type `md5`? I thought it would be necessary to use type `trust`...
Dan LaRocque
"trust" allows all users to connect without any password. That's something I wouldn't use, a password is the bare minimum you should always use. Even on your own computer.
Frank Heikens
ah, i read the question differently -- i thought he meant accept connections from all clients unconditionally (for some unimportant testbed, maybe). i see what you're getting at now.
Dan LaRocque
Yes worked a treat. Thanks Frank.
Fergal