Skip site navigation (1) Skip section navigation (2)

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

From: "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
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-31 17:33:14
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-jdbcpgsql-patches
On 8/30/06, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> I thought about this, and because we are placing two pieces of
> information on the same line, it seems "|" is the best choice.

Good idea. It's far more readable with a pipe.

> Oh.  You want to pull the parameters out of that.  I am thinking you
> need something that will go over the line character by character with
> some type of state machine, rather than just regex.

Yes, that's what I did but I usually prefer a regex.

> Additional comments?

I confirm it now works with NULL. I'm just wondering if the notation
is really consistent:
$result = pg_execute($dbconn, "insert_query", array(null));
DETAIL:  prepare: INSERT INTO shop (name) VALUES($1)  |  bind: $1 = NULL
$result = pg_execute($dbconn, "insert_query", array(4));
DETAIL:  prepare: INSERT INTO shop (name) VALUES($1)  |  bind: $1 = '4'

But I don't think it's possible to have 4 in this case. Can you confirm?

I have all the different cases parsed correctly by my parser and I can
build the query from the logs so it's OK for me. In the above case,
with an int, I remove the quotes if the content is numeric. It's not
perfect but I suppose it will be OK most of the time.


In response to


pgsql-hackers by date

Next:From: Martijn van OosterhoutDate: 2006-08-31 17:42:37
Subject: Re: Thought provoking piece on NetBSD
Previous:From: Martijn van OosterhoutDate: 2006-08-31 17:29:45
Subject: Re: Prepared statements considered harmful

pgsql-patches by date

Next:From: Tom LaneDate: 2006-08-31 18:29:46
Subject: Re: [HACKERS] Interval aggregate regression failure
Previous:From: Tom DunstanDate: 2006-08-31 16:09:34
Subject: Enums patch v1

pgsql-jdbc by date

Next:From: Bruce MomjianDate: 2006-08-31 18:48:19
Subject: Re: [HACKERS] [PATCHES] log_statement output for protocol
Previous:From: Markus SchaberDate: 2006-08-31 16:37:09
Subject: Re: Encoding problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group