Reporting the bind-parameter on an error

From: "Fujii Masao" <masao(dot)fujii(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Reporting the bind-parameter on an error
Date: 2008-08-15 10:53:02
Message-ID: 3f0b79eb0808150353r59a998f8i150ad5d49a94ebac@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Currently, the SQL statement that causes an error condition is reported
in the server log. On the other hand, the bind-parameter is not reported
as following.

> FATAL: terminating connection due to administrator command
> STATEMENT: UPDATE tbl SET name = $1 WHERE id = $2
> LOG: shutting down

The bind-parameter is useful information for debugging. So, I made
the small patch which reports the bind-parameter together with
the SQL statement on an error.

> FATAL: terminating connection due to administrator command
> STATEMENT: UPDATE tbl SET name = $1 WHERE id = $2
> DETAIL: parameters: $1 = 'hoge', $2 = '1'
> LOG: shutting down

Any comments welcome!

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
param_patch.diff application/octet-stream 7.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Pflug 2008-08-15 10:56:13 Re: migrate data 6.5.3 -> 8.3.1
Previous Message Guillaume Smet 2008-08-15 10:27:30 Re: migrate data 6.5.3 -> 8.3.1