pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dave Cramer <pg@fastcrypt.com>
Cc: Csaba Nagy <nagy@ecircle-ag.com>
Cc: Oliver Jowett <oliver@opencloud.com>
Cc: Postgres JDBC <pgsql-jdbc@postgresql.org>
Cc: Bruce Momjian <bruce@momjian.us>
Subject: Re: PGStatement#setPrepareThreshold
Date: Thu, 03 Aug 2006 15:59:47 -0400
Message-ID: <25044.1154635187@sss.pgh.pa.us> (raw)
In-Reply-To: <BD03ACFB-8073-4952-9FA0-8797DABD19D7@fastcrypt.com>
References: <1154529173.21451.27.camel@coppola.muc.ecircle.de>
	<44D19215.1070002@opencloud.com>
	<1154596670.21451.44.camel@coppola.muc.ecircle.de>
	<B4707B92-5F53-44B3-AFE0-F939C3559E51@fastcrypt.com>
	<BD03ACFB-8073-4952-9FA0-8797DABD19D7@fastcrypt.com>

Dave Cramer <pg@fastcrypt.com> writes:
> However I'm still puzzled by these backend logs

> <test test>LOG:  statement: PREPARE S_3 AS INSERT INTO texttable (te)  
> VALUES ($1)
> <test test>LOG:  statement: <BIND>
> <test test>LOG:  statement: EXECUTE <unnamed>  [PREPARE:  INSERT INTO  
> texttable (te) VALUES ($1)]

> We see the prepare to a named statement, but then the execute is  
> unnamed ?

What it's showing you there is the name of the protocol-level portal;
evidently you're using the unnamed portal to execute the INSERT.

This does demonstrate once again that the current approach to logging
parse/bind/execute operations is entirely wrongheaded, because it
deliberately confuses the protocol and SQL levels.  I see that Bruce
has changed CVS tip so that the message is

<test test>LOG:  statement: [protocol] EXECUTE <unnamed>  [PREPARE:  INSERT INTO  
texttable (te) VALUES ($1)]

but I hardly think that's going to be enough to de-confuse people.
All those brackets just serve to make things *more* confusing IMHO.

What I'd like to see is something like this:

Simple Query produces

	LOG: statement: ...statement text here...

Parse produces

	LOG: parse statement-name: ...statement text here...

Bind produces

	LOG: bind portal-name to statement-name (someday print arguments here)

Execute produces

	LOG: execute portal-name: ...statement text here...

No brackets, no pretending that an Execute message is the same thing
as a SQL EXECUTE command or that Parse is the same as PREPARE.

			regards, tom lane



view thread (28+ messages)  latest in thread

Message-ID: <25044.1154635187@sss.pgh.pa.us>
Permalink:  ../25044.1154635187@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25044.1154635187@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, pg@fastcrypt.com, nagy@ecircle-ag.com, oliver@opencloud.com, bruce@momjian.us
  Subject: Re: PGStatement#setPrepareThreshold
  In-Reply-To: <25044.1154635187@sss.pgh.pa.us>
  References: <1154529173.21451.27.camel@coppola.muc.ecircle.de> <44D19215.1070002@opencloud.com> <1154596670.21451.44.camel@coppola.muc.ecircle.de> <B4707B92-5F53-44B3-AFE0-F939C3559E51@fastcrypt.com> <BD03ACFB-8073-4952-9FA0-8797DABD19D7@fastcrypt.com> <25044.1154635187@sss.pgh.pa.us>

* 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