Re: [HACKERS] [PATCHES] log_statement output for protocol - Mailing list pgsql-jdbc

From Guillaume Smet
Subject Re: [HACKERS] [PATCHES] log_statement output for protocol
Date
Msg-id 1d4e0c10608311033u789f1145x449b3f1f9935f42f@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] [PATCHES] log_statement output for protocol  (Bruce Momjian <bruce@momjian.us>)
Responses Re: [HACKERS] [PATCHES] log_statement output for protocol
List pgsql-jdbc
On 8/30/06, Bruce Momjian <bruce@momjian.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));
gives:
DETAIL:  prepare: INSERT INTO shop (name) VALUES($1)  |  bind: $1 = NULL
However:
$result = pg_execute($dbconn, "insert_query", array(4));
gives:
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.

--
Guillaume

pgsql-jdbc by date:

Previous
From: Markus Schaber
Date:
Subject: Re: Encoding problem
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] [PATCHES] log_statement output for protocol