Ok, there seem to be no good instruction on how to install Drupal 6 on PostgreSQL.

I have created the database and granted the permissions in Postgres:

CREATE DATABASE drupaldb;
CREATE USER drupalapp WITH PASSWORD 'lapurd';
GRANT ALL ON DATABASE drupalbd TO drupalapp;

I have then tested the connection thusly:

psql -h localhost -p 5432 -U drupalapp -W -d drupaldb;

-- This Worked.

However, when I try to use the install script (Which seems to be written for MySQL only!) I get the following error:

Failed to connect to your MySQL database server. MySQL reports the following message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2).

* Are you sure you have the correct username and password?
* Are you sure that you have typed the correct database hostname?
* Are you sure that the database server is running?

For more help, see the Installation and upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.

If I try to enter the information into settings.php, I get directed to a "Site Offline" page with a note saying to check the settings.

Please... someone help.

Also, I'm not interested on a debate about with DB is better, personally I don't have a preference, but the project I'm working on requires Postgres to be on the server and I don't want to have to run two separate database servers.

Thanks,

Eli

Comments

HotDrupal.com’s picture

The database must be created with UTF-8 (Unicode) encoding.

Go to your sites/default/settings.php

change the line:

$db_url = 'mysql://username:password@localhost/databasename';

to

$db_url = 'pgsql://username:password@localhost/databasename';

Steve
HotDrupal

HotDrupal.com’s picture

Also note this comment from the handbook:

PostgreSQL 7.4 or higher

    * Note: Some contributed modules are not as abstracted from MySQL specific code as everyone would like. If you are familiar with PostgreSQL please file issues with those contributed modules as you find them.