Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 137069FB37B for ; Fri, 29 Sep 2006 12:12:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 60776-09 for ; Fri, 29 Sep 2006 12:12:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail709.megamailservers.com (mail709.megamailservers.com [69.49.98.19]) by postgresql.org (Postfix) with ESMTP id 4B5709FB34F for ; Fri, 29 Sep 2006 12:12:13 -0300 (ADT) X-Authenticated-User: paul.a.pnlassociates.com Received: from [69.3.2.106] (h-69-3-2-106.mclnva23.covad.net [69.3.2.106]) (authenticated bits=0) by mail709.megamailservers.com (8.13.6.20060614/8.13.1) with ESMTP id k8TFC8xH014703 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 29 Sep 2006 11:12:12 -0400 Message-ID: <451D37C8.8060502@pnlassociates.com> Date: Fri, 29 Sep 2006 11:12:08 -0400 From: "Paul B. Anderson" User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Stored procedure array limits References: <451C48AB.6090508@pnlassociates.com> <9461.1159502232@sss.pgh.pa.us> <451D34FD.3050709@pnlassociates.com> In-Reply-To: <451D34FD.3050709@pnlassociates.com> Content-Type: multipart/alternative; boundary="------------040706050003080609010805" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.396 tagged_above=0 required=5 tests=AWL, HTML_40_50, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200609/367 X-Sequence-Number: 23281 This is a multi-part message in MIME format. --------------040706050003080609010805 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Actually, I was not filling all of the arrays in sequential order. I added code to initialize them in order and the function seems to be working now. Is that a known problem? Paul Paul B. Anderson wrote: > I've checked my code and it does not seem to run past any limits. I > am filling the arrays in sequential order, extending each one in > parallel with the others. > > The null problem fixed the code for some cases but I'm still having > problems in general and with the same error message but reported in > another place. > > Paul > > > Tom Lane wrote: >> "Paul B. Anderson" writes: >> >>> I have a large stored procedure with 16 arrays, mostly varchar, each >>> with dimension 3000. The procedure works fine on a small number of rows >>> used from these arrays but gets the following error for large rowsets: >>> >> >> >>> ERROR: invalid array subscripts >>> >> >> Right offhand I only see that error being thrown for out-of-range array >> subscripts. Are you maybe trying to fill the arrays in nonsequential >> order? >> >> >>> If I comment out two particular arrays (that can have null values), it >>> also runs OK. >>> >> >> As already noted, we don't support nulls in arrays before 8.2, but >> I'm not exactly sure how that omission leads to this error message. >> >> regards, tom lane >> >> . >> >> --------------040706050003080609010805 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Actually, I was not filling all of the arrays in sequential order.  I added code to initialize them in order and the function seems to be working now.  Is that a known problem? 

Paul


Paul B. Anderson wrote:
I've checked my code and it does not seem to run past any limits.  I am filling the arrays in sequential order, extending each one in parallel with the others.

The null problem fixed the code for some cases but I'm still having problems in general and with the same error message but reported in another place.

Paul


Tom Lane wrote:
"Paul B. Anderson" <paul.a@pnlassociates.com> writes:
  
I have a large stored procedure with 16 arrays, mostly varchar, each 
with dimension 3000.  The procedure works fine on a small number of rows 
used from these arrays but gets the following error for large rowsets:
    

  
  ERROR:  invalid array subscripts
    

Right offhand I only see that error being thrown for out-of-range array
subscripts.  Are you maybe trying to fill the arrays in nonsequential
order?

  
If I comment out two particular arrays (that can have null values), it 
also runs OK.
    

As already noted, we don't support nulls in arrays before 8.2, but
I'm not exactly sure how that omission leads to this error message.

			regards, tom lane

.

  
--------------040706050003080609010805--