X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 488DBD7E67 for ; Tue, 15 Nov 2005 04:46:15 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 93910-09 for ; Tue, 15 Nov 2005 08:46:15 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by svr1.postgresql.org (Postfix) with ESMTP id C4691D6D8C for ; Tue, 15 Nov 2005 04:46:12 -0400 (AST) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 402C140C29D; Tue, 15 Nov 2005 08:46:08 +0000 (GMT) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 04A3715EA4; Tue, 15 Nov 2005 08:46:12 +0000 (GMT) Message-ID: <4379A053.3010501@archonet.com> Date: Tue, 15 Nov 2005 08:46:11 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lane Van Ingen Cc: pgsql-sql@postgresql.org Subject: Re: How to Log SELECT Statements Having Errors References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/117 X-Sequence-Number: 23368 Lane Van Ingen wrote: > We are putting a new application on PostgreSQL 8.0.1 (Windows 2003); > we are coming off of MySQL, and are having a hard time finding all of > the offending SQL calls. > > It would help a great deal if I could log the content of any SQL calls > that fail. Am only interested in SELECT statements. I don't know that you can only log SELECT statements that cause errors. It should be simple enough to log all statements that cause errors though: log_min_messages = error log_min_error_statement = error > Noticed the following: > (1) The PostgreSQL manual says that config parm 'log_statement' does > not appear to handle SELECT statements; true? The "all" setting should. -- Richard Huxton Archonet Ltd