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