Re: log bind parameter values on error

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>, Alexey Bashtanov <bashtanov@imap.cc>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2019-12-09T17:25:55Z
Lists: pgsql-hackers
On 2019-Dec-09, Alvaro Herrera wrote:

> I see four possible ways forward, with nuances.  In order of preference:
> 
> 1. change enough of the build system so that pg_encoding_mbcliplen is
>    available.  (Offhand I see no reason why we couldn't move the
>    function from mbutils.c to wchar.c, but I haven't tried.)

Ah, this seems to require putting encnames.o and wchar.o in src/common's
Makefile and moving pg_encoding_mbcliplen() from mbutils.c to wchar.c.
Fairly simple.

(There's a little bit of additional fallout because libpq also has
encnames/wchar in its roster, but I think this means we can just remove
them from there and let them be acquired via libpgcommon.)

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



Commits

  1. Emit parameter values during query bind/execute errors

  2. Add backend-only appendStringInfoStringQuoted