Re: log bind parameter values on error
От | Alvaro Herrera |
---|---|
Тема | Re: log bind parameter values on error |
Дата | |
Msg-id | 20191204133817.GA27976@alvherre.pgsql обсуждение исходный текст |
Ответ на | Re: log bind parameter values on error (Alvaro Herrera <alvherre@2ndquadrant.com>) |
Ответы |
Re: log bind parameter values on error
|
Список | pgsql-hackers |
> (Maybe do strnlen(maxlen), then count strnlen(1) starting at that point > -- so if that returns >=1, print the "..."?) So I found that I can make the code more reasonable with this simple coding, if (maxlen > 0) { s = pnstrdup(s, maxlen); ellipsis = strnlen(s, maxlen + 1) > maxlen; /* enlarge while we can do so cheaply */ enlargeStringInfo(str, maxlen); } ... but the problem is that we now compile stringinfo.c for frontend environments also, and there's no pnstrdup() in frontends. And to introduce it, we'd need a configure check (because GNU libc has it) and a src/port naive implementation and a fe_memutils.c addition. Sigh. Still, it's not that much code, so I'll just go do that and open a separate thread for it. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: