X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 7E1F59FB2A9 for ; Thu, 3 Aug 2006 17:00:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 42988-01-2 for ; Thu, 3 Aug 2006 19:59:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 1D45A9FB26F for ; Thu, 3 Aug 2006 16:59:52 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k73JxllT025045; Thu, 3 Aug 2006 15:59:47 -0400 (EDT) To: Dave Cramer cc: Csaba Nagy , Oliver Jowett , Postgres JDBC , Bruce Momjian Subject: Re: PGStatement#setPrepareThreshold In-reply-to: References: <1154529173.21451.27.camel@coppola.muc.ecircle.de> <44D19215.1070002@opencloud.com> <1154596670.21451.44.camel@coppola.muc.ecircle.de> Comments: In-reply-to Dave Cramer message dated "Thu, 03 Aug 2006 13:38:37 -0400" Date: Thu, 03 Aug 2006 15:59:47 -0400 Message-ID: <25044.1154635187@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200608/13 X-Sequence-Number: 15540 Dave Cramer writes: > However I'm still puzzled by these backend logs > LOG: statement: PREPARE S_3 AS INSERT INTO texttable (te) > VALUES ($1) > LOG: statement: > LOG: statement: EXECUTE [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 LOG: statement: [protocol] EXECUTE [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