Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D141B4765C5 for ; Sat, 28 Sep 2002 20:27:38 -0400 (EDT) Received: from mail.astrofoto.org (dsl092-102-177.nyc2.dsl.speakeasy.net [66.92.102.177]) by postgresql.org (Postfix) with ESMTP id 712D14764FA for ; Sat, 28 Sep 2002 20:27:35 -0400 (EDT) Received: from kuiper.rlent.pnet (IDENT:root@kuiper.rlent.pnet [192.168.3.50]) by mail.astrofoto.org (8.12.3/8.12.3) with ESMTP id g8T0RcUZ019909 for ; Sat, 28 Sep 2002 20:27:38 -0400 Received: (from roland@localhost) by kuiper.rlent.pnet (8.11.6/8.11.6) id g8T0Rcr06910; Sat, 28 Sep 2002 20:27:38 -0400 X-Authentication-Warning: kuiper.rlent.pnet: roland set sender to roland@astrofoto.org using -f To: pgsql-sql@postgresql.org Subject: Re: Passing array to PL/SQL and looping References: <1CAD483B723BD611B0C10090274FF068554860@NXCDMAIL> <200209261820.08106.josh@agliodbs.com> <1033140741.4254.12.camel@watto.interprose.net> From: Roland Roberts Date: 28 Sep 2002 20:27:37 -0400 In-Reply-To: <1033140741.4254.12.camel@watto.interprose.net> Message-ID: Lines: 30 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.90 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/397 X-Sequence-Number: 9674 >>>>> "Greg" == Greg Johnson writes: Greg> CREATE FUNCTION test_array( ) RETURNS VARCHAR[] AS ' Greg> DECLARE Greg> return_array VARCHAR[]; Greg> BEGIN Greg> return_array[0] := ''test''; Greg> return_array[1] := ''test 1''; Greg> return_array[2] := ''test 2''; Greg> RETURN (return_array); Greg> END;' Greg> LANGUAGE 'plpgsql'; Greg> I get the following error when I try to run it: Greg> ERROR: parse error at or near "[" on line 4. I raised this issue when dealing with version 7.1 and the conclusion was that PL/PgSQL doesn't understand array syntax. If you construct the array as { val, val, val, ... } it works, but that is not a practical solution for most uses. What can we do to at least get this on the radar screen as a known bug? roland -- PGP Key ID: 66 BC 3B CD Roland B. Roberts, PhD RL Enterprises roland@rlenter.com 76-15 113th Street, Apt 3B roland@astrofoto.org Forest Hills, NY 11375