Re: log bind parameter values on error - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: log bind parameter values on error
Date
Msg-id 20191204133817.GA27976@alvherre.pgsql
Whole thread Raw
In response to Re: log bind parameter values on error  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: log bind parameter values on error  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Update minimum SSL version
Next
From: Konstantin Knizhnik
Date:
Subject: Re: Session WAL activity