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:02:26Z
Lists: pgsql-hackers
On 2019-Dec-07, Tom Lane wrote: > 0001: > It is a very bad idea that this is truncating text without regard to > multibyte character boundaries. Hmm. So it turns out that we recently made stringinfo.c exported to frontends in libpgcommon. Clipping strings at a given character size means we need some facility like pg_encoding_mbcliplen. However, 1) pgcommon does not have wchar.c (libpq does have it), and 2) mbcliplen is not in wchar.c anyway. 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.) 2. in frontend, ignore the specified length; always copy the whole string. 3. don't allow length clipping in frontend. (We have no use for it in the near future.) 3a. Throw a run-time error if it's requested. 3b. throw a compile-time error if requested 4. don't provide this new function #if FRONTEND -- Á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