I recently red the following comment (by chx) about Drupal not supporting persistent connections: http://drupal.org/node/49836#comment-254512

As database.pgsql.inc states the following, I've always thought that they were actually supported (at least to some extent):

* Initialize a database connection.
* Note that you can change the pg_connect() call to pg_pconnect() if you
* want to use persistent connections. This is not recommended on shared hosts,
* and might require additional database/webserver tuning. It can increase
* performance, however, when the overhead to connect to your database is high
* (e.g. your database and web server live on different machines).

So, as I've most of the time ran the the database in different machine, I've been using pg_pconnect(). Only after I had red the said comment I realised that this is probably the reason I've been getting “table already exists” errors with code using temporary tables (e.g. search).

Now I'm considering filing a bug report to get that comment removed, or to get it patched with a statement that warns that persistent connections are not actually supported. Because right now it gives admins a quite confusing message that using persistent connetions is indeed at least partially supported.

What do people think? Should there be a clear statement that persistent connections are not supported? Or should them be more officially supported?

I think that the present situation is confusing.


unknownguy’s picture

Yes please, somebody should clarify this issue. I would like to know if the only issue with persistent connections is the temporary tables already-known problem, or if there are more issues that could render drupal as broken. I have been running Drupal 5 with persistent connections in a facebook-like community and I have not experienced any problem (visit http://www.yuglo.com), although I think we have hacked the search module a little bit.

I don't understand why chx gets so angry on comment http://drupal.org/node/49836#comment-379284, if persistent connections is not supported, please REMOVE this comment from the code, ASAP.