Re: PostgreSQL 8.4.8 bringing my website down every evening - Mailing list pgsql-general

From Alexander Farber
Subject Re: PostgreSQL 8.4.8 bringing my website down every evening
Date
Msg-id BANLkTi=_tTzj44H9Co27mqzAAxc02Xp1eg@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL 8.4.8 bringing my website down every evening  (Cédric Villemain <cedric.villemain.debian@gmail.com>)
Responses Re: PostgreSQL 8.4.8 bringing my website down every evening
Re: PostgreSQL 8.4.8 bringing my website down every evening
List pgsql-general
Sorry for the late reply - but I still haven't found a solution,
for example I have a PHP script with 5 consecutive SELECT
statements (source code + problem described again under:

http://stackoverflow.com/questions/6458246/php-and-pgbouncer-in-transaction-mode-current-transaction-is-aborted

) and if I add $db->beginTransaction(); $db->commit();
around each $db->prepare("select ..."); execute();
then my script will fail very often with

SQLSTATE[25P02]: In failed sql transaction: 7 ERROR:  current
transaction is aborted, commands ignored until end of transaction
block

But if I omit $db->beginTransaction(); $db->commit();
completely, then it will fail less often, but still fail with:

SQLSTATE[26000]: Invalid sql statement name: 7 ERROR: prepared
statement "pdo_stmt_00000016" does not exist

My guess is that the 2nd behaviour is less frequent
because it occurs only when pgbouncer switches
connections exactly between prepare()/execute().

If I try  PDO::ATTR_EMULATE_PREPARES => true
or pool_mode = session - my web site will hang.

Regards
Alex

pgsql-general by date:

Previous
From: Uwe Schroeder
Date:
Subject: Re: Oracle / PostgreSQL comparison...
Next
From: Eduard-Cristian Stefan
Date:
Subject: Relative path specified for data_directory is not working as expected