Question

I use pgpool-ii 3.2.1, php 5.3.3-7+squeeze14, postgresql 8.4.13.

I have some trouble with an insert query made by PDO, but I don't understand where the problem is because no log was written (postgres, apache2, pgpool-II).

The query is very simple, like

INSERT INTO table (column1, column2, ...) VALUES ('value1', 'value2', ...)

if I disable pgpool-II (with PDO enabled) everything goes fine, even if I disable PDO, doing the query with pg_query (with pgpool-II turned on), the queries were executed correctly. Other similar queries goes fine with PDO + pgpool-ii..anybody can help me?

Était-ce utile?

La solution

Please check your PDO Setting

setAttribute(PDO::ATTR_EMULATE_PREPARES, true);

And if you call beginTransaction();, dont forget to call commit();

But actually, if you already set PDO::ATTR_EMULATE_PREPARES to TRUE, you don't need to call beginTransaction(); and commit();

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top