Tag Archives: PostgreSQL

PostgreSQL remote access

PostgreSQL remote access

Configure PostgreSQL to listen for remote connections:
Change this in /etc/postgresql/9.3/main/pg_hba.conf

listen_addresses = '*'

Configure PostgreSQL to accept remote connections (from any host):
Add this to /etc/postgresql/9.3/main/pg_hba.conf

host    all         all         0.0.0.0/0             md5

Configure PostgreSQL to accept remote connections (from 192.168.0.0/24 host):
Add this to /etc/postgresql/9.3/main/pg_hba.conf

host    all         all         192.168.0.0/24        md5

Restart PostgreSQL for the changes to take effect:

service postgresql restart

Links:
www.postgresql.org