Re: Arrays in pl/pgsql functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Donald Fraser" <demolish(at)cwgsy(dot)net>
Cc: "[ADMIN]" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Arrays in pl/pgsql functions
Date: 2003-07-17 18:18:42
Message-ID: 5658.1058465922@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Donald Fraser" <demolish(at)cwgsy(dot)net> writes:
> CREATE OR REPLACE FUNCTION test_arrays() RETURNS int4[] AS '
> DECLARE
> test int4[];
> BEGIN
> test[1] := 1;
> RETURN test;
> END ' LANGUAGE 'plpgsql';

> If I try to execute this function I get:
> WARNING: plpgsql: ERROR during compile of test_arrays near line 5
> ERROR: syntax error at or near "["

Existing releases of plpgsql don't support assignment to array elements.
I believe Joe Conway has fixed this for 7.4, though.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2003-07-17 18:32:30 Re: pg_dump: dumpBlobs(): error reading large object: ERROR:
Previous Message Donald Fraser 2003-07-17 18:10:33 Re: Arrays in pl/pgsql functions