Re: PostgreSQL 8.4.8 bringing my website down every evening

From: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL 8.4.8 bringing my website down every evening
Date: 2011-06-23 17:48:04
Message-ID: BANLkTi=_tTzj44H9Co27mqzAAxc02Xp1eg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2011-06-23 18:25:29 Re: to_timestamp() and timestamp without time zone
Previous Message hernan gonzalez 2011-06-23 17:05:59 Re: to_timestamp() and timestamp without time zone