Re: log bind parameter values on error

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Alexey Bashtanov <bashtanov(at)imap(dot)cc>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: log bind parameter values on error
Date: 2019-11-07 22:02:28
Message-ID: 20191107220228.GA8765@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

So, if some parameters are large (they can be up to 1 GB-1, remember)
then we can bloat the log file severely. I think we need to place an
upper limit on the strings that we're going to log -- as inspiration,
callers of ExecBuildValueDescription uses 64 chars per value maximum.
Something like that seems reasonable. So I think you need to add some
pg_mbcliplen() calls in a couple of places in exec_bind_message.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-11-07 22:15:19 Re: log bind parameter values on error
Previous Message Mark Dilger 2019-11-07 21:57:57 Re: Safeguards against incorrect fd flags for fsync()