Re: log bind parameter values on error
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Alexey Bashtanov <bashtanov@imap.cc>
Cc: Andres Freund <andres@anarazel.de>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2019-12-05T17:19:45Z
Lists: pgsql-hackers
Attachments
- v15-0001-Add-appendStringInfoStringQuoted.patch (text/x-diff)
I made a number of changes on the proposed patch and ended up with the attached. (I have not included the business to limit number of characters, yet). 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. This is not final form; there are a couple of XXX comments, and a number of other small infelicities still to fix. But the overall idea should be final. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Emit parameter values during query bind/execute errors
- ba79cb5dc841 13.0 landed
-
Add backend-only appendStringInfoStringQuoted
- 6cafde1bd43f 13.0 landed