Re: BUG #8289: pg_stat_statements incorrect query text when executing multiple queries in a single PQexec

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #8289: pg_stat_statements incorrect query text when executing multiple queries in a single PQexec
Дата
Msg-id 2128.1373397656@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #8289: pg_stat_statements incorrect query text when executing multiple queries in a single PQexec  (potapov.dmitry@gmail.com)
Список pgsql-bugs
potapov.dmitry@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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Jamey Poirier
Дата:
Сообщение: Re: BUG #8290: broken/unexpected locking behavior
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #8290: broken/unexpected locking behavior