Re: Passing array to PL/SQL and looping - Mailing list pgsql-sql

From Roland Roberts
Subject Re: Passing array to PL/SQL and looping
Date
Msg-id m265wpljwm.fsf@kuiper.rlent.pnet
Whole thread Raw
In response to Re: Passing array to PL/SQL and looping  (Greg Johnson <gregj@interprose.com>)
Responses Re: Passing array to PL/SQL and looping  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
>>>>> "Greg" == Greg Johnson <gregj@interprose.com> 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


pgsql-sql by date:

Previous
From: Ian Barwick
Date:
Subject: Re: Passing array to PL/SQL and looping
Next
From: Tom Lane
Date:
Subject: Re: Passing array to PL/SQL and looping