Re: log bind parameter values on error

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: log bind parameter values on error
Дата
Msg-id 20191209170225.GA26084@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: log bind parameter values on error  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: log bind parameter values on error  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: log bind parameter values on error  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [Proposal] Level4 Warnings show many shadow vars
Следующее
От: "Finnerty, Jim"
Дата:
Сообщение: Re: Corruption with duplicate primary key