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 href="http://techdocs.postgresql.org/guides/GUITools">PostgreSQL GUI's
  • Go ahead and create your database tables via phpPgSQL or via the command line as described here.

Comments

mindcorrosive’s picture

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

sambesange’s picture

Dear All,

I wanted to install drupal on windows XP with XAMPP + POSTGRES as database. Now I want to know the steps. I am giving what I have done.

1. Downloaded and installed XAMPP.
2. Downloaded and installed DRUPAL.
3. Downloaded and installed Postgres.

How I should configure PHP in XAMPP to work with postgres ? i.e. do i need to compile php with postgres, then how ?

Can I get step-by-step guide online on net for all this ?

Regards,

mafister’s picture

Hi,

I followed your directions and it worked, but than I made some experiments:

In c:\windos\system32 directory I found two of listed dll's - libeay32.dll and ssleay32.dll - both considerably smaller in size from those located in Postgres bin directory. I moved them temporarily to another location. After doing this I copied listed 9 dlls to c:\windows\system32 directory. Than I was removing one by one these dll's restarting each time Apache, until Postgres disappeared from phpinfo() output. This revealed that the only two dlls required for proper start of Postgres extension were libeay32.dll and ssleay32.dll. As next I added to Windows system path Postgres bin directory, restarted computer and removed remaining two dlls from c:\windows\system32 directory. Postgres extension still worked.

Looks like the problem was in 2 small dll's which have been placed in c:\windows\system32 directory before (I don't know the exact moment of this event though. Must have been some other application installation.) After adding Postgres bin directory to system path, the two dlls were still visible, even if removed from c:\windows\system32 directory.

Hope this helps (and forgive me my English... *s*)