php 5.2.x, PDO, libpq bug

Posted on February 02, 2008

I am working on writing up a test scenario to submit the bug report, but I thought I'd let people know of a PDO+libpq issue I've recently found. The problem manifests itself in prepared statements. Using libpq for PostgreSQL 8.0 or higher, under heavy use, PDO will somehow drop prepared statements before PostgreSQL has set them up, so in the logs, you will see lots of entries like the following:

ERROR:  prepared statement "pdo_pgsql_stmt_b6dc71e8" does not exist

The quick fix is to install libpq for PostgreSQL 7.4 and recompile PHP against that. I'll update more when I have additional information.