Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id DE3559FA2A6 for ; Sat, 2 Dec 2006 03:19:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 04442-01 for ; Sat, 2 Dec 2006 03:19:12 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by postgresql.org (Postfix) with ESMTP id F34FF9F9BEC for ; Sat, 2 Dec 2006 03:19:13 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id x4so3872995nfb for ; Fri, 01 Dec 2006 23:19:12 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=B2hXfsG+R9m6/hwU9dl6rwd+t6hIvBIed+nO6GbPYHxFD9Y/TxZWvKmKjuLcKzekoOk4YjdkFor21fUp8dCq3MTwfxioACeythF9/3bgo2jmncu67Xo6V7ZVuF4iSzl493i/ebEtn5ULLI0fl7CcSNT8La0g06YG4lPPyrPxo/s= Received: by 10.78.201.10 with SMTP id y10mr5629222huf.1165043952498; Fri, 01 Dec 2006 23:19:12 -0800 (PST) Received: by 10.78.136.6 with HTTP; Fri, 1 Dec 2006 23:19:12 -0800 (PST) Message-ID: Date: Sat, 2 Dec 2006 01:19:12 -0600 From: "Aaron Bono" To: "Tom Lane" Subject: Re: Tracking Down Error in Stored Procedure Cc: "sql pgsql" In-Reply-To: <8476.1165040459@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8684_8932691.1165043952468" References: <8476.1165040459@sss.pgh.pa.us> X-Google-Sender-Auth: dcf16372c8d3443f X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/23 X-Sequence-Number: 26979 ------=_Part_8684_8932691.1165043952468 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 12/2/06, Tom Lane wrote: > > "Aaron Bono" writes: > > CONTEXT: PL/pgSQL function "update_web_site_hits_fn" line 200 at > execute > > statement > > > My question is this: What is line 200? Is it the 200th line after the > > CREATE part of the stored procedure? Or is it the 200th line after the > > BEGIN? Or maybe something else? > > It's the 200th line in the function body string. IIRC there is a > special case to not count a leading newline in the body string, > so that the counting goes like > > CREATE FUNCTION foo ... > RETURNS ... > AS $$ > DECLARE -- this is line 1 > > or without exploiting the special case > > CREATE FUNCTION foo ... > RETURNS ... > AS $$DECLARE -- this is line 1 > > regards, tom lane > I got it fixed. Thanks for the help! -- ================================================================== Aaron Bono Aranya Software Technologies, Inc. http://www.aranya.com http://codeelixir.com ================================================================== ------=_Part_8684_8932691.1165043952468 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 12/2/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"Aaron Bono" <postgresql@aranya.com> writes:
> CONTEXT:  PL/pgSQL function "update_web_site_hits_fn" line 200 at execute
> statement

> My question is this:  What is line 200?  Is it the 200th line after the
> CREATE part of the stored procedure?  Or is it the 200th line after the
> BEGIN?  Or maybe something else?

It's the 200th line in the function body string.  IIRC there is a
special case to not count a leading newline in the body string,
so that the counting goes like

CREATE FUNCTION foo ...
  RETURNS ...
  AS $$
    DECLARE             -- this is line 1

or without exploiting the special case

CREATE FUNCTION foo ...
  RETURNS ...
  AS $$DECLARE          -- this is line 1

                        regards, tom lane

I got it fixed.  Thanks for the help!

--
==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
   http://codeelixir.com
================================================================== ------=_Part_8684_8932691.1165043952468--