Re: statement logging / extended query protocol issues

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Oliver Jowett <oliver(at)opencloud(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: statement logging / extended query protocol issues
Date: 2005-09-08 07:41:32
Message-ID: 200509080741.j887fWG29640@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Oh, I didn't realize a FETCH would show up as an EXECUTE. That is wrong
and should be fixed because a user-level FETCH shows up as a fetch, not
as the original query.

---------------------------------------------------------------------------

Simon Riggs wrote:
> > Oliver Jowett wrote:
> > > 8.1-beta1 produces some odd results with statement logging enabled when
> > > the extended query protocol is used (e.g. when using the JDBC driver).
> > > Repeatedly running a simple query with log_statement = 'all' produces this:
> ...
>
> > > Secondly, running a query that uses portals produces output like this:
> > >
> > > LOG: statement: PREPARE S_3 AS SELECT * from pg_proc
> > > LOG: statement: <BIND> C_4
> > > LOG: statement: EXECUTE C_4 [PREPARE: SELECT * from pg_proc]
> > > LOG: statement: EXECUTE C_4 [PREPARE: SELECT * from pg_proc]
> > > LOG: statement: EXECUTE C_4 [PREPARE: SELECT * from pg_proc]
> > > LOG: statement: EXECUTE C_4 [PREPARE: SELECT * from pg_proc]
> > > LOG: statement: EXECUTE C_4 [PREPARE: SELECT * from pg_proc]
> > > LOG: statement: EXECUTE C_4 [PREPARE: SELECT * from pg_proc]
> > > LOG: statement: EXECUTE C_4 [PREPARE: SELECT * from pg_proc]
> > >
> > > Comments:
> > > - The <BIND> is still fairly content-free.
> > > - The EXECUTEs are a bit misleading as the SELECT was actually only run
> > > once (there are multiple Execute messages for the same portal). You
> > > could infer that there is only one SELECT from the repeated portal name
> > > and the lack of an intervening <BIND>, I suppose.
>
> I've put together this prototype to offer more useful messages in the
> situation Oliver describes.
>
> Subsequent calls to the same portal are described as FETCHes rather than
> as EXECUTEs. The portal name is still given and number of rows is
> provided also.
>
> I haven't tested this with the java program supplied, since this is a
> fairly short-hack for comments. I'll correct any mistakes before
> submission to patches.
>
> Comments?
>
> Best Regards, Simon Riggs

[ Attachment, skipping... ]

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message ITAGAKI Takahiro 2005-09-08 09:02:44 Alternative variable length structure
Previous Message Dave Page 2005-09-08 07:09:26 Re: [COMMITTERS] pgsql: Update timezone data files to release 2005m of the zic database.

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2005-09-08 17:00:08 Re: For review: Initial support for COLLATE
Previous Message Martijn van Oosterhout 2005-09-08 06:04:34 Re: For review: Initial support for COLLATE