Re: log bind parameter values on error - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: log bind parameter values on error
Date
Msg-id b88e8929-1eaf-67d6-2b33-76e462624d12@2ndquadrant.com
Whole thread Raw
In response to Re: log bind parameter values on error  (Alexey Bashtanov <bashtanov@imap.cc>)
Responses Re: Re: log bind parameter values on error
Re: log bind parameter values on error
List pgsql-hackers
On 2019-02-15 15:02, Alexey Bashtanov wrote:
> Hello Anders and Peter,
> 
> Thanks for your messages.
> Please see the new patch version attached.

In my testing, I couldn't get this patch to do anything.  Could you
please share your testing steps?

I did

postgres -D data --log-parameters-on-error=on

pgbench -i bench

alter table pgbench_accounts alter column aid type smallint;

pgbench -M extended -S -T 10 bench

This will then error out on type overflows, but I don't see any
parameters being logged:

ERROR:  value "62812" is out of range for type smallint
STATEMENT:  SELECT abalance FROM pgbench_accounts WHERE aid = $1;

(In this case the error message contains the parameter value, so it's
not a very practical case, but it should work, it seems.)

Meanwhile, I have committed a patch that refactors the ParamListInfo
initialization a bit, so you don't have to initialize hasTextValues in a
bunch of places unrelated to your core code.  So please rebase your
patch on that.

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


pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: [Proposal] Table-level Transparent Data Encryption (TDE) and KeyManagement Service (KMS)
Next
From: Andrew Dunstan
Date:
Subject: Re: pgsql: Add support for hyperbolic functions, as well as log10().