In this tutorial I set up PostgreSQL as server for BPS on a windows 7 workstation, for example as a testing environment. Newer releases of PostgreSQL might have slightly different procedures, but the overall process should be more or less the same. Other flavors of windows will basicly also work the same way.
This tutorial is addressing people who are not yet familiar with PostgreSQL administration and want to install it first time. If you need to install the database in a more complex environment, on an other operating system, or need to tune the database for maximum performance, please check out the PostgreSQL documentation instead.
The website of the PostgreSQL project my change over time, so take the following instructions just as general direction how to find and download the correct package. You should find the site at http://www.postgresql.org/.
Find the download page and go for the latest release:
Choose the binary windows 32 bit distribution.
Choose the one-click installer:
Take the latest available release:
Start the downloaded installer:
Click Next after enjoying the welcome screen:
I recommend to use the suggested installation directory if you have no special reason to use another path:
The data directory is suggested to go also in the program folder. I think that is not the most smart option, from a perspective of separating application and data, as well as backup, it might be better to select another directory:
Choose a password for the the postgres accounts in the database (as superuser account) and in windows (as account where the service will run under):
If the default port 5432 is not yet taken by another TCP/IP service on the machine, I recommend to leave the default:
Leave the advanced options as suggested:
Click Next on the ready to install screen:
Wait until the software is installed:
On the final screen, uncheck the stack builder launch option and click Finish.
The software is now installed on your computer.
After installation the system PATH environment variable needs to be extended by the PostgreSQL directories holding EXE's and DLL's so applications like BPS can find the drivers automatically. The procedure for Windows 7 is described below.
Open the Start menu, right click on Computer and click on Properties:
Click on Advanced system settings:
In the Advanced tab, click on Environment Variables…:
Edit Path unter System variables:
Add the bin and lib paths of your PostgreSQL installation folder to the end of the list, separating the paths by semicolon:
Save the settings:
Under Windows 7 the changes to the system path are immediately valid for subsequent started programs. If you are however installing on another Windows version, it might be necessary to reboot the computer.
The default does not allow accessing the datastore from other client machines. If you only want a single testing machine this is ok and you can skip this chapter. However for a real installation you need to do the following additional steps on the server PC:
To configure the service, start up PgAdmin III and connect as postgres:
Select the default postgres database, open the tools menu, server configuration, pg_hba.conf:
Select the yet empty record and double click on it to open it for editing:
Enter the settings as below, but at the IP address enter the network address of your own LAN in CIDR notation instead. (My LAN in the example below has the IP addresses 10.56.xxx.xxx, with the first 16 bits relevant for network identification, hence the /16):
After confirming the dialog with OK, click on the save and then on the reload button to make the service start with the new settings. You will see two reminder windows about being sure that the settings are ok, which you can confirm (if everything entered ok):
Next you must add a rule to the firewall to allow external (incoming) access on TCP/IP port 5432:
You may continue now with: Preparing PostgreSQL for BPS