Re: [HACKERS] [PATCHES] log_statement output for protocol

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Oliver Jowett <oliver(at)opencloud(dot)com>, Dave Cramer <pg(at)fastcrypt(dot)com>, Csaba Nagy <nagy(at)ecircle-ag(dot)com>, Postgres JDBC <pgsql-jdbc(at)postgresql(dot)org>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] [PATCHES] log_statement output for protocol
Date: 2006-08-29 20:10:12
Message-ID: 200608292010.k7TKAC204184@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc pgsql-patches

Guillaume Smet wrote:
> On 8/29/06, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > DETAIL: prepare: SELECT $1; bind: $1 = 'a''b'
>
> I attached a trivial patch to add a dash between the prepare part and
> the bind part. People usually don't finish their queries with a semi
> colon so it's more readable with a separator.
> DETAIL: prepare: SELECT $1 bind: $1 = 'a''b'
> becomes
> DETAIL: prepare: SELECT $1 - bind: $1 = 'a''b'

Good point. I thought it was clear enough, but obviously not. I had a
similar case with bind, and used a comma to separate them:

LOG: statement: prepare sel1, SELECT $1;
LOG: statement: bind sel1, $1 = 'a''b'

I am concerned a dash isn't clear enough, and a semicolon is confusing.
Using a comma the new output is:

LOG: duration: 0.023 ms execute sel1
DETAIL: prepare: SELECT $1;, bind: $1 = 'a''b'

or with no semicolon:

LOG: duration: 0.023 ms execute sel1
DETAIL: prepare: SELECT $1, bind: $1 = 'a''b'

Is that OK? Patch attached and committed. I also fixed the null bind
parameter bug. It now displays $1 = NULL (no quotes used). Other
suggestions?

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/bjm/diff text/x-diff 2.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2006-08-29 20:35:14 Re: [COMMITTERS] pgsql: Second try committing the path changes.
Previous Message Devrim GUNDUZ 2006-08-29 19:59:26 Re: [Pgsqlrpms-hackers] Safer auto-initdb for RPM init

Browse pgsql-jdbc by date

  From Date Subject
Next Message Luis Vilar Flores 2006-08-29 22:02:34 Re: outOfMemoryError
Previous Message Dave Cramer 2006-08-29 16:59:59 Re: outOfMemoryError

Browse pgsql-patches by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-08-29 21:00:29 Re: [PATCHES] Another VPATH patch for ecpg
Previous Message Chris Browne 2006-08-29 18:46:06 Changes to epgc test