Friday 6 February 2009

PostgreSQL - First Things First

After installing PostgreSQL the installation is available to access only from the local machine. If however you have installed it on a remote server or VM you will initially be unable to connect. This is because (sensibly) PostgreSQL comes with a highly restrictive table of allowed connections. Therefore the first thing to do is give yourself access to your PostgreSQL database from over the local network.

These are the steps to follow to set this up:

From the machine which contains the PostgreSQL installation, launch the pGAdmin III application. If you don't have this you should run Application Stack Builder included with the PG installation and download it.

Once pGAdmin III is launched it will look something like this:



From the File menu select the option 'Open pg_hba.conf...' This will open a dialog asking you the location of this file. Navigate to your data directory and select the pg_hba.conf file.

You will then see this:



Double Click the third line down in the list and populate the window as follows:



Press OK to close the input window, close the list window, answering Yes to the prompt to Save changes and close pgAdmin III.

You now need to Restart the PostgreSQL server process using the shortcut installed by the PG installer.

Your PG database will now be accessible from your Local Area Network (assuming you use the IP Range 192.168.0.X, if you use a different IP Range then substitute it when editing the pg_hba.conf file.)

www.artenscience.co.uk
Quality Commercial Software and Custom Software Development


Arten Science RSS Feed

No comments: