X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D18B0476782 for ; Wed, 14 May 2003 10:45:10 -0400 (EDT) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with ESMTP id 31260-01 for ; Wed, 14 May 2003 10:45:06 -0400 (EDT) Received: from lerami.lerctr.org (lerami.lerctr.org [207.158.72.11]) by postgresql.org (Postfix) with ESMTP id 67E35476105 for ; Tue, 13 May 2003 20:32:10 -0400 (EDT) Received: from lerlaptop.lerctr.org (lerlaptop.lerctr.org [207.158.72.14]) (authenticated bits=0) by lerami.lerctr.org (8.12.9/8.12.9/20030225) with ESMTP id h4DNPsKK013002; Tue, 13 May 2003 18:25:54 -0500 (CDT) Date: Tue, 13 May 2003 18:25:54 -0500 From: Larry Rosenman To: Tom Lane , josh@agliodbs.com Cc: pgsql-sql@postgresql.org Subject: Re: Ok, how do I debug THIS? Message-ID: <26910000.1052868353@lerlaptop.lerctr.org> In-Reply-To: <19270.1052868140@sss.pgh.pa.us> References: <246160000.1052853868@lerlaptop.iadfw.net> <200305131231.34175.josh@agliodbs.com> <256400000.1052854454@lerlaptop.iadfw.net> <200305131245.26203.josh@agliodbs.com> <19270.1052868140@sss.pgh.pa.us> X-Mailer: Mulberry/3.0.3 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/270 X-Sequence-Number: 13435 --On Tuesday, May 13, 2003 19:22:20 -0400 Tom Lane wrote: > Josh Berkus writes: >>> I just did a head. Note the line count above. It's only 147 >>> lines, but the error refers to line 206. > >> Obviously postgres is counting lines differently from you. > > Just FYI, I noticed the other day while testing some plpgsql changes > that the 7.3 plpgsql seems to double-count newlines appearing inside > quoted literals --- that is, if you have a syntax error appearing after > a multiline literal, the reported line number will be too large. This > seems to explain Larry's bizarre message, since most of the function > was being taken as a multiline literal. AH! Thank You for the explanation. (the quoting rules get weird, and I haven't done much PL/pgSQL coding (as if you couldn't tell).). > > The reason I noticed this was that the updated version counts correctly, > and thus gave different answers. I don't know exactly where the bug > really was --- the changes involved ripping out the use of yylineno > entirely, so I did not look to see just where the double counting had > been happening. Makes sense. Thanks again! > > regards, tom lane -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749