Re: prepared statements don't log arguments?

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: prepared statements don't log arguments?
Дата
Msg-id 42549A94.3040209@opencloud.com
обсуждение исходный текст
Ответ на Re: prepared statements don't log arguments?  (Neil Conway <neilc@samurai.com>)
Ответы Re: prepared statements don't log arguments?  (Neil Conway <neilc@samurai.com>)
Re: prepared statements don't log arguments?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Neil Conway wrote:
> Christopher Kings-Lynne wrote:
> 
>> I think he has a really excellent point.  It should log the parameters
>> as well.
> 
> 
> neilc=# prepare foo(int, int) as select $1 + $2;
> PREPARE
> neilc=# execute foo(5, 10);
> ...
> neilc=# execute foo(15, 20);
> ...
> 
> % tail /usr/local/pgsql/postmaster.log
> LOG:  statement: prepare foo(int, int) as select $1 + $2;
> LOG:  statement: execute foo(5, 10);
> LOG:  statement: execute foo(15, 20);

Query-level EXECUTE is logged, but Bind/Execute via the V3 extended
query protocol (which is what the JDBC driver does) isn't.

In fact, the logging for the extended query protocol really sucks: the
server logs only the Parse, and is silent about Bind/Execute, so there
are all sorts of strange cases where your statement logs do not reflect
what was actually executed at all. For example, the JDBC driver issues a
Parse (but no Execute!) when an application asks for type metadata from
a query, and it can issue multiple Bind/Executes for a single Parse.

I've raised this before on -hackers but haven't had time to do anything
about it myself yet.

-O


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: prepared statements don't log arguments?
Следующее
От: Neil Conway
Дата:
Сообщение: Re: prepared statements don't log arguments?