Re: passing array as argument and returning an array in

From: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
To: "K(dot) Deepa" <kdeepa(at)midascomm(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: passing array as argument and returning an array in
Date: 2003-12-16 12:25:35
Message-ID: Pine.LNX.4.44.0312161324340.29120-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hello

It is possible

CREATE OR REPLACE FUNCTION foo(anyarray) RETURNS anyarray AS '
DECLARE b integer[];
BEGIN b := $1; b[1] := b[1] + 1;
RETURN b;
END;
' LANGUAGE plpgsql;

testdb011=> select foo(ARRAY[1,2,3]);
foo
---------
{2,2,3}
(1 řádka)

Regards
Pavel

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Paul Ganainm 2003-12-16 13:34:15 Re: add column sillyness
Previous Message Marek Lewczuk 2003-12-16 11:56:46 Re: UTF support in WIN32 native and Lower/Upper in 7.5