pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Raul Kaubi <raulkaubi@gmail.com>
To: pgsql-general@postgresql.org
Subject: How to log bind values for statements that produce errors
Date: Tue, 7 Sep 2021 10:43:07 +0300
Message-ID: <DDFC3268-EDD9-4A76-AEEE-55ACD3FB25B6@gmail.com> (raw)

H
Centos7, postgres 13

We have a problem with certain select statement, which produces error and we would like to know the bind value that is given as parameter.

At the moment, the column is bigint type, and probably the bind that goes there is text, in postgresql logfile, the error is following.

operator does not exist: bigint = text

And it does log this select statement as well, where the bind value is $1.
“.. col1 = $1…”

I have tried parameters:
log_min_duration_statement = 0
log_parameter_max_length_on_error = -1

But still nothing. The first parameter logs binds only for succeeded statements. While the second one logs only this select statement and this error, but no binds are logged.

Is there any possibilities to log this bind value to postgresql.log file..?

Regards
Raul

Sent from my iPhone=

view thread (3+ messages)  latest in thread

Message-ID: <DDFC3268-EDD9-4A76-AEEE-55ACD3FB25B6@gmail.com>
Permalink:  ../DDFC3268-EDD9-4A76-AEEE-55ACD3FB25B6@gmail.com/
Also on:    postgresql.org/message-id/DDFC3268-EDD9-4A76-AEEE-55ACD3FB25B6@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: raulkaubi@gmail.com
  Subject: Re: How to log bind values for statements that produce errors
  In-Reply-To: <DDFC3268-EDD9-4A76-AEEE-55ACD3FB25B6@gmail.com>
  References: <DDFC3268-EDD9-4A76-AEEE-55ACD3FB25B6@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox