Re: passing array as argument and returning an array in - Mailing list pgsql-general

From Pavel Stehule
Subject Re: passing array as argument and returning an array in
Date
Msg-id Pine.LNX.4.44.0312161324340.29120-100000@kix.fsv.cvut.cz
Whole thread Raw
In response to passing array as argument and returning an array in plpgsql  ("K. Deepa" <kdeepa@midascomm.com>)
List 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


pgsql-general by date:

Previous
From: Marek Lewczuk
Date:
Subject: Re: UTF support in WIN32 native and Lower/Upper in 7.5
Next
From: Paul Ganainm
Date:
Subject: Re: add column sillyness