Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNVlG-0006Ws-4v for pgsql-general@arkaria.postgresql.org; Tue, 07 Sep 2021 07:43:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mNVlE-0006TM-Ko for pgsql-general@arkaria.postgresql.org; Tue, 07 Sep 2021 07:43:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNVlE-0006TE-AL for pgsql-general@lists.postgresql.org; Tue, 07 Sep 2021 07:43:16 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mNVlA-0001pI-67 for pgsql-general@postgresql.org; Tue, 07 Sep 2021 07:43:15 +0000 Received: by mail-lf1-x12c.google.com with SMTP id n2so8305845lfk.0 for ; Tue, 07 Sep 2021 00:43:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:from:mime-version:date:subject:message-id :to; bh=cAl8PS5bfWKxJj/qgf8D+d9YupT+puB5LkQsav/LJf4=; b=AykJEpyKV/N1D3vdJYqyYZk5YdKNyrn+fqA58JYgM4oG4Bm0XoHqMxK9VlyeGU01gH N1EiFe8ekdqs0G7wYDjb0wQqbZCkHp/r1ALF64DA0bEMGrEL1HPnbk23ef/r5u1Ae7rv fwixEOe3KxPnG1jn/cvNuHuQ1H+U6bM8d9J6I/cVegEyWfTGKYd4t2ENNUQJW/SvQh0P Sf4cyImnV8Fgic799wXL02iAg6U73tLN9HkNRlfsBMjwLX6TAke6wxCVXbwy1GuB8N4z IJ6Vmy55cbp6CJp11NUjJ4Uo38m86UvMbp9uR6uJFZYU8DbMXhHWfA5gNkBA5ukyUr0G t13w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version:date :subject:message-id:to; bh=cAl8PS5bfWKxJj/qgf8D+d9YupT+puB5LkQsav/LJf4=; b=WrdKJvBuDOFLvP8NY4GlDM8mwmSkGjHml9AGWmOz2fcilqoJ3fFdkKCsVF0EA6KDI0 W5uHe2jJ/TnPFD3vKCOUOXfcdNa9F/gHUYZ65asIrirpCuFWG97ivSvb/7vQ+ICJXp6v 7PX1/2J8ya4hDeMbYXsbtsCREoCdVYnINY9PyHtIrenG8oHa32g3m4bMu4xMjtJ4Od4N YAUonFrzztRA7JZAJfaLhj0dNf42U9yGzCMvkntyAdcVs/rSYVaRL0+Z0kD9emcAL0rT cjsq+iAf0486PET3ejNpEADkGq8zuy0Mqxol2Xm9QUhTl3UdcEor12hTlxOIpMEXCF99 pbKA== X-Gm-Message-State: AOAM533GPxxbLEpMRdEbdAgHTgqhKGwZ8nBDbyyjYGd1LG9bSdNhxmhI iKKmBYC971wYWx406Q1BHIb4ZZtkhRQ= X-Google-Smtp-Source: ABdhPJyGmtGPlstQF1+bOwTrxsceLt+avCIqJWja289qfKqGK7n1SNjH1VWaoRsiO4TO8joRnJUN/w== X-Received: by 2002:a05:6512:214f:: with SMTP id s15mr11785440lfr.56.1631000590124; Tue, 07 Sep 2021 00:43:10 -0700 (PDT) Received: from smtpclient.apple (m91-129-103-242.cust.tele2.ee. [91.129.103.242]) by smtp.gmail.com with ESMTPSA id m15sm929888lfj.236.2021.09.07.00.43.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Sep 2021 00:43:09 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-0B62CCD6-885A-43B8-9C27-1DCBE7C2909F Content-Transfer-Encoding: 7bit From: Raul Kaubi Mime-Version: 1.0 (1.0) Date: Tue, 7 Sep 2021 10:43:07 +0300 Subject: How to log bind values for statements that produce errors Message-Id: To: pgsql-general@postgresql.org X-Mailer: iPhone Mail (18G82) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail-0B62CCD6-885A-43B8-9C27-1DCBE7C2909F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 th= ere is text, in postgresql logfile, the error is following. operator does not exist: bigint =3D text And it does log this select statement as well, where the bind value is $1. =E2=80=9C.. col1 =3D $1=E2=80=A6=E2=80=9D I have tried parameters: log_min_duration_statement =3D 0 log_parameter_max_length_on_error =3D -1 But still nothing. The first parameter logs binds only for succeeded stateme= nts. While the second one logs only this select statement and this error, bu= t no binds are logged. Is there any possibilities to log this bind value to postgresql.log file..? Regards Raul Sent from my iPhone= --Apple-Mail-0B62CCD6-885A-43B8-9C27-1DCBE7C2909F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable H
Centos7, postgres 13

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

At the moment, the column is bigint type, and probably t= he bind that goes there is text, in postgresql logfile, the error is followi= ng.

operator does not exist: bigint =3D text=

And it does log this select statement as well, whe= re the bind value is $1.
=E2=80=9C.. col1 =3D $1=E2=80=A6=E2=80=9D=

I have tried parameters:
log_min_duratio= n_statement =3D 0
log_parameter_max_length_on_error =3D -1

But still nothing. The first parameter logs bin= ds 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
= --Apple-Mail-0B62CCD6-885A-43B8-9C27-1DCBE7C2909F--