I
I
Ivan Palamarchuk2017-10-20 13:59:54
PHP
Ivan Palamarchuk, 2017-10-20 13:59:54

How to overcome PostgreSQL prepared statement error?

I can not understand how to overcome this error, who faced, tell me ..

STATEMENT:  DEALLOCATE pdo_stmt_00000001
2017-10-20 09:36:45.379 UTC [30435] [email protected] ERROR:  prepared statement "pdo_stmt_00000001" does not exist
2017-10-20 09:36:45.379 UTC [30435] [email protected] STATEMENT:  DEALLOCATE pdo_stmt_00000001
2017-10-20 09:36:45.382 UTC [30435] [email protected] ERROR:  prepared statement "pdo_stmt_00000001" already exists
2017-10-20 09:36:45.382 UTC [30435] [email protected] STATEMENT:  SELECT * FROM sessions WHERE token = $1 LIMIT 1;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Palamarchuk, 2017-10-21
@delef

As Melkij suggested , pgbouncer does not support server-side prepared statements in transaction-mode. Therefore, we simply enable emulation inside PDO.

$pdo = new \PDO(PG_DSN, PG_USER, PG_PASSWORD);
$pdo->setAttribute(\PDO::ATTR_EMULATE_PREPARES, true);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question