[RESOLVED: see thread below]
I started in the regular support forums but they seem to be full of messages on the order of "I don't know anything about PostgreSQL, can anyone verify that it works?" That seemed rather odd to me given that Drupal supposedly now supports use of the PostgreSQL server.
Anyway, I am trying to get a Drupal 6.1 installation up and running with PostgreSQL 7.4 running on Debian Linux 4.0 (etch). I've been over the installation instructions several times, but can't get the install.php procedure to successfully connect to the PostgreSQL server, which is running on the same host as Drupal.
After supplying the database name, user name, and password, I get an error screen stating that the connection failed. It tells me to check the PostgreSQL log for the reason.
The only error indicated there, once each time I try to run the Drupal installation, is:
2008-03-24 10:02:02 LOG: incomplete startup packet
PostgreSQL is working, and does accept queries and database modifications entered from the command line. The user and database created for Drupal to use are available and functional in that mode. This certainly appears to be a flaw in the Drupal setup code, but I'm not fluent enough in PHP to find it. I gather that many of you here have Drupal running on a PostgreSQL database. Any idea what I'm missing?
--Gary Phillips, Librarian, Harvard Diggins Library, Harvard, Illinois

Comments
more info
first off, what version of Drupal are you trying to install?
How about posting your PostgreSQL config file? It's possible that
you are able to connect to PostgreSQL locally via UNIX sockets but
it's not setup for TCP/IP connections...
start with providing as much info as you can :)
re: More info
Drupal is the latest version from the web site, 6.1, downloaded on Monday.
PostgreSQL is version 7.4 with default settings. It is enabled for tcp/ip connections on port 5432.
Apache is 2.2, PHP is 5.2, Linux is Debian 4.0.
The postgresql.conf is 8K long and I don't see a way to do it as an attachment here. Surely you don't want me to paste the whole thing into a comment?
The psql command from the command line gives access to the drupaldb database I set up without any complaint, using either the drupal user I set up or the postgres superuser. Yes, that might be using UNIX sockets, true. I can try going via port 5432 from another machine, but not until I get into work later today (firewall will block it from here.) The fact that PostgreSQL is receiving a connection attempt and rejecting it as "incomplete" seems to imply that communication is happening, though, so the port wanted by Drupal must be open. I tried deleting the database and user and redefining them, but got the same result. I also tried the same installation procedure here at home on another machine also running Debian 4.0 and the same PostgreSQL and Drupal, with the same results.
--Gary Phillips, Librarian, Harvard Diggins Library, Harvard, Illinois
--Gary Phillips, Librarian, Harvard Diggins Library, Harvard, Illinois
Can you write up a little
Can you write up a little PHP script to make sure you cannot connect from PHP using the
same connect method as Drupal would be using?
<?php
$connection = pg_connect('user=drupal_user password=password host=host dbname=dbname');
var_dump($connection);
?>
where user, password, host and dbname are of course the ones for your server.
If $connection is FALSE then we know it's not Drupal per se but a problem between PHP and
PostgreSQL which is most likely going to be related to the PostgreSQL setup.
Thanks!
That was the debugging tool I needed.
I only got around this morning to trying the psql connection from another host, and that failed as well.
You were on the right track all along. Apparently psql was using a Unix socket even when directed to use port 5432.
Though the postgresql.conf file was properly configured after the database was installed, the testing for a successful install all went through Unix sockets and the machine had not been rebooted since. That was more than a month ago, sometimes the stability of Linux systems can be obstructive :)
Your script produced a failure to connect also. I rebooted the machine, and like a miracle, Drupal was able to configure itself. Thanks very much for your help.
--Gary Phillips, Librarian, Harvard Diggins Library, Harvard, Illinois
--Gary Phillips, Librarian, Harvard Diggins Library, Harvard, Illinois
a happy ending
no problem! And for what it's worth, you should consider upgrading to PostgreSQL 8
PostgreSQL 8.3 is the latest and greatest and continues to improve by leaps
and bounds
And glad to see another Debian user...been on board since '99
When I checked a few weeks
When I checked a few weeks ago, version 8.3 was still in the "beta" category for Debian on the Alpha. This is an AlphaServer, and releases move a little more slowly through the Debian Alpha group because they have a lot fewer people doing the development and testing.
When 8.x is rated "stable" then I'll probably move to it.
--Gary Phillips, Librarian, Harvard Diggins Library, Harvard, Illinois
--Gary Phillips, Librarian, Harvard Diggins Library, Harvard, Illinois
Postgres 8.1 and 8.2 are not
Postgres 8.1 and 8.2 are not in Beta. I've been using 8.2 for long time and 8.1 for over a year. Works fine. Actually there are some issues with Drupal and Postgres 8.3, but 8.2 is great.
I realize that for the whole
I realize that for the whole world at large, the 8.x releases are not beta. I didn't say they were.
Debian on the Alpha platform moves more slowly though, for many reasons. 8.1 is in fact available as a "stable" release now on the Alpha, but when this machine was installed last September, 7.4 was the current stable release in Debian Alpha. Consequently, that's the package that was included in the distribution kit and that's what I installed in January.
The 8.3 release will be moved to the stable configuration for Alpha sometime in the next few months, I'm sure, and I will consider upgrading at that time. Managing software releases and equipment is not my primary or even my secondary job here. I move slowly too because I can't devote a lot of time to frequent updates and fixes.
--Gary Phillips, Librarian, Harvard Diggins Library, Harvard, Illinois
--Gary Phillips, Librarian, Harvard Diggins Library, Harvard, Illinois