pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Smet <guillaume.smet@gmail.com>
To: Bruce Momjian <bruce@momjian.us>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Oliver Jowett <oliver@opencloud.com>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: Csaba Nagy <nagy@ecircle-ag.com>
Cc: Postgres JDBC <pgsql-jdbc@postgresql.org>
Cc: PostgreSQL-patches <pgsql-patches@postgresql.org>
Subject: Re: [HACKERS] [PATCHES] log_statement output for protocol
Date: Thu, 31 Aug 2006 19:33:14 +0200
Message-ID: <1d4e0c10608311033u789f1145x449b3f1f9935f42f@mail.gmail.com> (raw)
In-Reply-To: <200608301821.k7UILIT21208@momjian.us>
References: <1d4e0c10608300025s2880837bi6fe3e7566b14edde@mail.gmail.com>
	<200608301821.k7UILIT21208@momjian.us>

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



view thread (21+ messages)  latest in thread

Message-ID: <1d4e0c10608311033u789f1145x449b3f1f9935f42f@mail.gmail.com>
Permalink:  ../1d4e0c10608311033u789f1145x449b3f1f9935f42f@mail.gmail.com/
Also on:    postgresql.org/message-id/1d4e0c10608311033u789f1145x449b3f1f9935f42f@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: guillaume.smet@gmail.com, bruce@momjian.us, tgl@sss.pgh.pa.us, oliver@opencloud.com, pg@fastcrypt.com, nagy@ecircle-ag.com, pgsql-patches@postgresql.org
  Subject: Re: [HACKERS] [PATCHES] log_statement output for protocol
  In-Reply-To: <1d4e0c10608311033u789f1145x449b3f1f9935f42f@mail.gmail.com>
  References: <1d4e0c10608300025s2880837bi6fe3e7566b14edde@mail.gmail.com> <200608301821.k7UILIT21208@momjian.us> <1d4e0c10608311033u789f1145x449b3f1f9935f42f@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox