Re: Array as parameter for plpgsql function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Pratt <fairwinds(at)eastlink(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Array as parameter for plpgsql function
Date: 2005-07-13 14:08:01
Message-ID: 27735.1121263681@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Pratt <fairwinds(at)eastlink(dot)ca> writes:
> CREATE FUNCTION create_record_test(text[][]) RETURNS int4 AS '
> DECLARE
> test_array ALIAS FOR $1; -- alias for input array
> BEGIN
> return array_upper(test_array,1)
> END;
> ' LANGUAGE 'plpgsql';

> SELECT create_record_test(ARRAY[ARRAY['A','test one'],ARRAY['B','test
> two']]) AS output;

Works fine for me, once I add the semicolon you forgot:

return array_upper(test_array,1);

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2005-07-13 14:10:16 Re: 7.4.7: strange planner decision
Previous Message Tom Lane 2005-07-13 14:04:56 Re: strange error with temp table: pg_type_typname_nsp_index