Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 3FF959FB322 for ; Tue, 26 Sep 2006 11:37:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 58391-10 for ; Tue, 26 Sep 2006 14:37:16 +0000 (UTC) X-Greylist: delayed 00:17:49.02843 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 746B19FB406 for ; Tue, 26 Sep 2006 11:37:16 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from tao.actarg.com (host25.actarg.com [209.180.91.25]) by svr4.postgresql.org (Postfix) with ESMTP id DFA215AF893 for ; Tue, 26 Sep 2006 14:19:25 +0000 (GMT) Received: from [192.168.2.5] (chi.actarg.com [192.168.2.5]) by tao.actarg.com (8.13.1/8.13.1) with ESMTP id k8QEJLIw002222 for ; Tue, 26 Sep 2006 08:19:22 -0600 Message-ID: <451936E9.1050201@actarg.com> Date: Tue, 26 Sep 2006 08:19:21 -0600 From: Kyle Bateman User-Agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Finding context for error log Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200609/165 X-Sequence-Number: 26376 I get the following message in my postgres log: ERROR: 42601: syntax error at or near "%" at character 269 LOCATION: yyerror, scan.l:761 I have a fairly complex schema (lots of database objects) and many users hitting the db with lots of connections, so I'm not really sure what bit of code is causing the problem. Is there an easy way to get postgres to spit out the SQL statement it was parsing when it generated the error? I've experimented with log_error_verbosity and log_min_messages but still haven't seen any SQL in the log. Kyle