X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 24F089DC9B6 for ; Tue, 28 Mar 2006 08:12:45 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23043-06 for ; Tue, 28 Mar 2006 08:12:47 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 4BD3C9DC848 for ; Tue, 28 Mar 2006 08:12:42 -0400 (AST) Received: (qmail 9610 invoked from network); 28 Mar 2006 12:12:45 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 28 Mar 2006 12:12:45 -0000 In-Reply-To: <1143541956.3839.329.camel@localhost.localdomain> References: <442890D9.40905@catalyst.net.nz> <1143541956.3839.329.camel@localhost.localdomain> Mime-Version: 1.0 (Apple Message framework v746.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: Kevin Dorne , pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: Printing query durations Date: Tue, 28 Mar 2006 07:12:44 -0500 To: Simon Riggs X-Mailer: Apple Mail (2.746.3) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.133 required=5 tests=[AWL=0.133] X-Spam-Score: 0.133 X-Spam-Level: X-Archive-Number: 200603/128 X-Sequence-Number: 14909 Simon, What happens if I turn log_duration on ? Doesn't it prepend the duration to every log ? Dave On 28-Mar-06, at 5:32 AM, Simon Riggs wrote: > On Tue, 2006-03-28 at 13:26 +1200, Kevin Dorne wrote: > >> I am having some trouble getting PostgreSQL to log durations with >> statements when called through JDBC. They appear just fine with >> interactive queries using psql, but the duration field does not >> show up >> on JDBC queries. >> >> Is there some configuration I need to pass to the JDBC driver? > > These two logging formats are each produced by different parameters: > >> Example output from an interactive query: >> LOG: duration: 109.524 ms statement: SELECT count(*) FROM >> transaction; > > This is produced by log_min_duration_statement > -1 > These lines always have duration prefixes. > >> Example output from a JDBC query: >> LOG: statement: SELECT count(*) FROM transaction; > > This is produced by log_statement = 'all' > These lines never have durations. > If you want the matching durations, use log_duration = on and read the > manual to see how to match them up. > > The same statement can be logged twice using those options. > > http://www.postgresql.org/docs/8.1/static/runtime-config- > logging.html#RUNTIME-CONFIG-LOGGING-WHAT > > Does that answer your query? > > Best Regards, Simon Riggs > > > ---------------------------(end of > broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that > your > message can get through to the mailing list cleanly >