X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BE3479DC984 for ; Fri, 3 Mar 2006 14:20:25 -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 26306-10 for ; Fri, 3 Mar 2006 14:20:25 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by postgresql.org (Postfix) with ESMTP id ACFC29DC9A9 for ; Fri, 3 Mar 2006 14:20:23 -0400 (AST) Received: from [192.168.0.5] (unknown [84.12.26.47]) by smtp.nildram.co.uk (Postfix) with ESMTP id 2F2A72546A8; Fri, 3 Mar 2006 18:20:20 +0000 (GMT) Subject: Re: SELECT statements in log files From: Simon Riggs To: mario.splivalo@mobart.hr Cc: pgsql-admin@postgresql.org In-Reply-To: <1141384781.8893.8.camel@localhost.localdomain> References: <1141384781.8893.8.camel@localhost.localdomain> Content-Type: text/plain Date: Fri, 03 Mar 2006 18:20:14 +0000 Message-Id: <1141410014.27729.521.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.091 required=5 tests=[AWL=0.091] X-Spam-Score: 0.091 X-Spam-Level: X-Archive-Number: 200603/44 X-Sequence-Number: 20801 On Fri, 2006-03-03 at 12:19 +0100, Mario Splivalo wrote: > We're using JDBC to connect to postgres server. I've setup logging so > that any query that executes over 100ms gets logged. But, the log file > looks like this: > > > 2006-03-03 12:17:08 CET [31591] SELECTLOG: duration: > 253.307 ms statement: EXECUTE [PREPARE: select * from > create_mt_sms_message($1, $2, $3, $4, $5, $6, $7, $8, $9) as result] > > Now, I guess this happened when we switched to the fresh JDBC driver for > postgres 8.1. Before that I could see the actuall values for the $1, $2, > $3 parameters... > > Is this a known 'issue', or am I doing something wrong here? Is there a > way to see actuall values using new JDBC driver? > > The java client code didn't change a bit. We just switched to > postgres8.1, and upgraded the JDBC driver used by tomcat. The new driver switched from non-prepared statements to prepared statements. The logging is different in each case and is useful because you can compare similar SQL statements more easily than before. You should hopefully have noticed a performance improvement also with prepared statements. Logging parameter values is likely to be there for 8.2, but I don't think that is likely to be back-ported to 8.1. Could you say how you'd *like* it to work in detail, so we can get some opinions on how best to implement this. I've posted an initial design about a month ago on -general but without much response. > When I connect to postgres from PHP or Python or using just psql, I can > see full SELECT querries logged, with the actuall values for the > parameters. Those interfaces do not use prepared statements, so are not logged in the same way. Best Regards, Simon Riggs