X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 3EF889FB311 for ; Fri, 4 Aug 2006 15:57:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 19193-08 for ; Fri, 4 Aug 2006 15:57:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from momjian.us (momjian.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id B10B89FB30C for ; Fri, 4 Aug 2006 15:57:04 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id k74IurK20224; Fri, 4 Aug 2006 14:56:53 -0400 (EDT) From: Bruce Momjian Message-Id: <200608041856.k74IurK20224@momjian.us> Subject: Re: PGStatement#setPrepareThreshold In-Reply-To: Date: Fri, 4 Aug 2006 14:56:53 -0400 (EDT) CC: Tom Lane , Dave Cramer , Oliver Jowett , Csaba Nagy , Postgres JDBC X-Mailer: ELM [version 2.4ME+ PL122k (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1154717813-19228-0_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.068 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/27 X-Sequence-Number: 15554 --ELM1154717813-19228-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" bruce wrote: > Tom Lane wrote: > > Bruce Momjian writes: > > > Dave Cramer wrote: > > >> Bind also has a statement name, as well as a portal name ? > > >> > > >> Ideally I'd like to see the parameters which were bound and the > > >> types, but I suspect I'm reaching here. > > > > > Right, but do we want to repeat the statement for every bind case? > > > > My upthread proposal was to print the statement and portal names > > at bind time. The current printout is very clearly inadequate. > > Sure, I can do that. > > Did you like my idea of? > > statement: ... > > You didn't reply. I want to keep the "statement:" prefix for scripts > that process our log files, and because it is output by log_statement, > which controls protocol output as well. I have applied this patch to output the statemented referenced by BIND. I also changed the "[protocol]" string to "" for clarity. I am ready to pull PREPARE|BIND|EXECUTED into the "protocol" bracket too if someone says that is a good idea. -- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + --ELM1154717813-19228-0_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/bjm/diff" Index: src/backend/tcop/postgres.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/tcop/postgres.c,v retrieving revision 1.493 diff -c -c -r1.493 postgres.c *** src/backend/tcop/postgres.c 29 Jul 2006 03:02:56 -0000 1.493 --- src/backend/tcop/postgres.c 4 Aug 2006 18:50:59 -0000 *************** *** 1146,1153 **** if (log_statement == LOGSTMT_ALL) ereport(LOG, ! (errmsg("statement: [protocol] PREPARE %s AS %s", ! (*stmt_name != '\0') ? stmt_name : "", query_string))); /* --- 1146,1153 ---- if (log_statement == LOGSTMT_ALL) ereport(LOG, ! (errmsg("statement: PREPARE %s AS %s", ! *stmt_name ? stmt_name : "", query_string))); /* *************** *** 1452,1458 **** /* We need to output the parameter values someday */ if (log_statement == LOGSTMT_ALL) ereport(LOG, ! (errmsg("statement: [protocol] %s", portal_name))); /* * Fetch parameters, if any, and store in the portal's memory context. --- 1452,1460 ---- /* We need to output the parameter values someday */ if (log_statement == LOGSTMT_ALL) ereport(LOG, ! (errmsg("statement: %s [PREPARE: %s]", ! *portal_name ? portal_name : "", ! portal->sourceText ? portal->sourceText : ""))); /* * Fetch parameters, if any, and store in the portal's memory context. *************** *** 1718,1726 **** if (log_statement == LOGSTMT_ALL) /* We have the portal, so output the source query. */ ereport(LOG, ! (errmsg("statement: [protocol] %sEXECUTE %s [PREPARE: %s]", execute_is_fetch ? "FETCH from " : "", ! (*portal_name) ? portal_name : "", portal->sourceText ? portal->sourceText : ""))); BeginCommand(portal->commandTag, dest); --- 1720,1728 ---- if (log_statement == LOGSTMT_ALL) /* We have the portal, so output the source query. */ ereport(LOG, ! (errmsg("statement: %sEXECUTE %s [PREPARE: %s]", execute_is_fetch ? "FETCH from " : "", ! *portal_name ? portal_name : "", portal->sourceText ? portal->sourceText : ""))); BeginCommand(portal->commandTag, dest); *************** *** 1826,1836 **** secs, msecs))); else ereport(LOG, ! (errmsg("duration: %ld.%03d ms statement: [protocol] %sEXECUTE %s [PREPARE: %s]", secs, msecs, execute_is_fetch ? "FETCH from " : "", ! (*portal_name) ? portal_name : "", ! portal->sourceText ? portal->sourceText : ""))); } } --- 1828,1838 ---- secs, msecs))); else ereport(LOG, ! (errmsg("duration: %ld.%03d ms statement: %sEXECUTE %s [PREPARE: %s]", secs, msecs, execute_is_fetch ? "FETCH from " : "", ! *portal_name ? portal_name : "", ! portal->sourceText ? portal->sourceText : ""))); } } --ELM1154717813-19228-0_--