0

Postgres supports both a simple and extended "query mode".

With JDBC I can use preferQueryMode=simple to force the driver to use simple mode when issuing queries.

How can I do the same with PDO and the PDO_PGSQL extension in PHP? The server I am currently querying (a PgBouncer instance, to retrieve stats) does not support extended mode queries, and all of my queries (issued via Symfony/Doctrine) fail with a ERROR: unsupported pkt type: 80 error.

Adam Williams
  • 1,712
  • 3
  • 17
  • 30

1 Answers1

0

Setting the PDO::ATTR_EMULATE_PREPARES flag to be enabled is enough to prevent extended mode queries from being issued, it seems.

In Symfony you do this by adding an option to the Doctrine YAML config under the relevant connection:

  options:
    20: true
Adam Williams
  • 1,712
  • 3
  • 17
  • 30