INSTALLATION: PostgreSQL is not showing up as option under database configuration

netdawg's picture
  1. Web Server: apache 2.2.22 on Windows
  2. Using php as apache module version 5.3.13
  3. PostgresSQL 9.0 is FULLY functional with other PHP applications.

Installed Drupal 7 - and started configuration with


go through all steps with no errors until "Database configuration" under which I see only two options:

  1. MySQL, MariaDB or equivalent
  2. SQLlite

As mentioned PostgreSQL is working just fine. So, the solution in

is not applicable - since it advises to simply install php-pgsql - which is just a matter of pointing to the extensions directory under windows.

Then tried the direct connection recommended in

This leads to the dreaded "Drupal already installed" twilight zone. When you try update, you get weird errors like "need PDO etc" which has been deprecated long ago,


There are two PostgreSQL

Josh Waihi's picture

There are two PostgreSQL extensions in PHP. One is called pgsql which is the old version. Drupal 6 runs on this. The other is pdo_pgsql. Drupal 7 requires this.

This is what you'll need to have enabled to make PostgreSQL an available option to use when installing Drupal.

YES - that did it - BASICALLY

netdawg's picture

For some reason php_pdo_pgsql.dll was NOT in the ext directory with by PHP installation (Windows Installer). However, it is available in the binary zip file. That was it.

Put into the ext directory and included it. Now only PostgreSQL shows up and not MySQL, SQLlite etc. Just the way I wanted.

PDO, PostGreSQL etc can be confirmed by doing phpinfo()

However, it is important to note that there appears to be an IMPLICIT Load File of libpq.dll from within c:\php directory. Even in the latest version of php (5.4.7) this is apparently at PostGreSQL 8..3.3 wheras my PostGreSQL version is 9+. To fix this you may want to experiment with:

  1. Using LoadFile %POSTGRES_HOME%/bin/libpq.dll in Apache conf, OR
  2. Copy over the ancient libpql.dll within PHP with PostGreSQL distribution.

Lastly, and this is just a warning - just my experience - all OTHER php apps - besides Drupal - using legacy "pg_connect" will fail after activating PDO. This pretty much ensures (for me) to have a dedicated apache instance for Drupal - probably for the best anyway.

probably your enviornment

metzlerd's picture

I have been connecting to Posgres 9.x databeses with the 8..3 php drivers for years without trouble. You do not need and 9.x client to connect to a 9.x database.

I also have code in drupal instances that connects both with PDO annd pg_connect side by side, so you still have an environment problem if you're getting this behavior. You can and should have both the PDO and the normal Postgres drivers installed if you want to connect with both devices.


Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week