How to log bind values for statements that produce errors

From: Raul Kaubi <raulkaubi(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to log bind values for statements that produce errors
Date: 2021-09-07 07:43:07
Message-ID: DDFC3268-EDD9-4A76-AEEE-55ACD3FB25B6@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Uckun 2021-09-07 08:46:38 Re: Choosing an index on partitioned tables.
Previous Message Laurenz Albe 2021-09-07 07:24:21 Re: Choosing an index on partitioned tables.