Re: PGStatement#setPrepareThreshold

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, Csaba Nagy <nagy(at)ecircle-ag(dot)com>, Oliver Jowett <oliver(at)opencloud(dot)com>, Postgres JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PGStatement#setPrepareThreshold
Date: 2006-08-04 03:57:53
Message-ID: 200608040357.k743vrw28938@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


One complexity of changing the prefix to not use "statement:" is that
log_statement does control this output. Changing that might cause
confusion, especially for scripts that process the logs. How do you
like "statement: <protocol execute>"?

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

Tom Lane wrote:
> Dave Cramer <pg(at)fastcrypt(dot)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

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2006-08-04 12:07:41 Re: PGStatement#setPrepareThreshold
Previous Message Bruce Momjian 2006-08-04 03:55:02 Re: PGStatement#setPrepareThreshold