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

From Alvaro Herrera
Subject Re: log bind parameter values on error
Date
Msg-id 20191205183336.GA30063@alvherre.pgsql
Whole thread Raw
In response to Re: log bind parameter values on error  (Andres Freund <andres@anarazel.de>)
Responses Re: log bind parameter values on error
List pgsql-hackers
Hello

On 2019-Dec-05, Andres Freund wrote:

> On 2019-12-05 14:19:45 -0300, Alvaro Herrera wrote:
> > What this does is set an error callback, which adds the parameter values
> > in the DETAIL line.  This is at odds with all existing error callbacks:
> > they only add stuff to the CONTEXT string.  The implication is that
> > if an error site has a direct errdetail_log() and is run under this
> > error stack, that site's detail is going to be lost and replaced by the
> > "params" one.  Currently there aren't many errdetail_log() lines, so it
> > doesn't seem like a terrible problem.  However, it's something to keep
> > in mind.
> 
> It'd not be too hard avoiding overwriting if we wanted.

Hmm, maybe errdetail_log() ought to do that.  However: if some place has
errdetail() and then this introduces errdetail_log(), then the former is
not included in the server log (only in the client log).

> Makes me wonder though, if we ought to invent something similar to the
> errdata fields we have for schema, table, etc...

Hmm, perhaps we should do that.  It avoids the problem altogether.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Append with naive multiplexing of FDWs
Next
From: Robert Haas
Date:
Subject: Re: [Proposal] Level4 Warnings show many shadow vars