DevPinoy.org
A Filipino Developers Community
   
Steps to enable remote access to your PostgreSQL server
For those who are installing the PostgreSQL database for the first time, this tip might be useful.

Most of the time you want to connect to your database using an external database client. For security reasons, Postgres does not allow you to connect remotely.

I installed the 8.1 version.  Please note that the configuration is different from the 7.X versions.

There are two very simple steps you have to follow:

1. Edit the postgresql.conf file found in <postgres-install-dir>/data. This assumes that you initialized the database and create the data files under the default installation. Add this line.

listen_addresses = '*'

For the previous versions, this used to be "tcpip_socket = true".

2. By default Postgres blocks all clients connecting to it so you have to add the ff. line in pg_hba.conf. The file is located in the same directory as the previous configuration file:

host    all     all         0.0.0.0/0               trust

This configuration is not the recomended one since it allows all IP addresses to connect. You can check out the Postgres documentation on how to allow specific addresses. Please do not use this configuration in production systems.

Now you can connect using your favorite database administration tool. Smile




Posted 09-29-2006 2:53 PM by javazealot
Copyright DevPinoy 2005-2008