potapov.dmi...@gmail.com writes: > The testcase runs five UPDATE commands with two PQexec calls. > First PQexec call runs: "UPDATE t1 SET a=101 WHERE id=0; UPDATE t1 SET a=102 > WHERE id=1; UPDATE t1 SET a=103 WHERE id=2" > Second PQexec call runs: "UPDATE t2 SET b=1 where a=0; UPDATE t2 SET a=2 > WHERE b=3"
> I expect pg_stat_statements to contain three records with following query > texts: > 1) UPDATE t1 SET a=? WHERE id=? > 2) UPDATE t2 SET b=? where a=? > 3) UPDATE t2 SET a=? WHERE b=? > Instead it contains three records with following query texts: > 1) "UPDATE t2 SET b=1 where a=0; UPDATE t2 SET a=? WHERE b=?" > 2) "UPDATE t1 SET a=? WHERE id=?; UPDATE t1 SET a=102 WHERE id=1; UPDATE t1 > SET a=103 WHERE id=2" > 3) "UPDATE t2 SET b=? where a=?; UPDATE t2 SET a=2 WHERE b=3" Yeah, that's what's going to happen, because there is no infrastructure for determining which portion of the source text string belongs to which query. I suspect there are some other infelicities in pg_stat_statements' behavior for multi-query strings, too. At least for now, that combination is best avoided. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs