Installing PostgreSQL on Windows
Last modified: April 4, 2006 - 00:11
Postgres is easily installed and administered on Windows. See PostgreSQL on Windows for the options you have.
- As of this writing, the apparently easiest choice for PostgreSQL on Windows is "UltraSQL by PeerDirect" mentioned at above link. It is available from here. See the README file enclosed in the download and Installing the PeerDirect PostgreSQL beta for Windows for more instructions. After completing installation, the username for your DB is your windows login name and there is no password.
- You might want to install phpPgSQL in order to admin your database. It will save you frustation at the command line. A more complete list of all known PostgreSQL GUI tools is available at PostgreSQL GUI's
- Go ahead and create your database tables via phpPgSQL or via the command line as described here.

PHP/Postgres Black Magic on Win32
There are some voodoo tricks that one should go through in order to get PHP working with Postgres on Win32. I cannot tell whether all of the following steps are required, but at least these Worked For Me (tm).
0. Be sure to select the Postgres module (php_pgsql.dll) when installing PHP.
1. Be sure to add your PHP install directory to the PATH, especially if Apache complains something like:
Unable to load dynamic library '$PATH/PHP/ext/php_pdo_pgsql.dll' - The specified module could not be found.
The trick above worked if you are using MySQL, but for Postgres, several things more need to be done:
2. Download the latest Postgres binaries-no-install archive from http://www.postgresql.org/ftp/binary/vx.x.x/win32/
and copy the following libraries to C:\WINDOWS\system32
comerr32.dll
gssapi32.dll
k5sprt32.dll
krb5_32.dll
libeay32.dll
libiconv2.dll
libintl3.dll
libpq.dll
ssleay32.dll
3. Restart Apache, and you should be good to go.
This seem as a particularly invasive procedure, but I could not make it work any other way. Other suggestions?
The original instructions I used can also be found here