Re: log bind parameter values on error

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: log bind parameter values on error
Дата
Msg-id 96007f6e-1e42-e454-9db4-e7842e137508@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: log bind parameter values on error  (Alexey Bashtanov <bashtanov@imap.cc>)
Ответы Re: log bind parameter values on error  (Alexey Bashtanov <bashtanov@imap.cc>)
Список pgsql-hackers
There appears to be a problem with how this affects current logging
behavior.

I'm using

    pgbench -M extended -S -T 10 bench

to test the extended protocol.

Unpatched, with log_statement=all, you get something like

LOG:  execute <unnamed>: SELECT abalance FROM pgbench_accounts WHERE aid
= $1;
DETAIL:  parameters: $1 = '30223'

With your patch, with log_statement=all and log_parameters=on, you get
the same, but with log_statement=all and log_parameters=off you get

LOG:  execute <unnamed>: SELECT abalance FROM pgbench_accounts WHERE aid
= $1;
DETAIL:  parameters: $1 = UNKNOWN TYPE

We should probably keep the existing parameter logging working as before.

This also raises the question of the new parameter name.  Parameters are
already logged.  So the name should perhaps be more like
log_parameters_on_error.

Some API notes on your patch:  I think you can change
get_portal_bind_parameters() to take a ParamListInfo, since you're not
doing anything with the Portal other than grab the parameters.  And that
would allow you to keep the signature of errdetail_params() unchanged.

I did some performance tests using the commands shown above and didn't
find any problems.  Obviously the default pgbench stuff isn't very
parameter-intensive.  Do you have tests with more and larger parameter
values?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: "could not reattach to shared memory" on buildfarm member dory
Следующее
От: David Rowley
Дата:
Сообщение: Re: Delay locking partitions during query execution