Re: plpgsql function return array - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: plpgsql function return array
Date
Msg-id 20070331125546.GA23812@winnie.fuhr.org
Whole thread Raw
In response to plpgsql function return array  (Karthikeyan Sundaram <skarthi98@hotmail.com>)
List pgsql-sql
On Sat, Mar 31, 2007 at 12:43:44AM -0700, Karthikeyan Sundaram wrote:
> Hi,     I am using Postgres 8.1.0.  I have a requirement. I will
> create a function accepting few parameters.  This will check into
> various tables and give back an array of values.  I want to use the
> pgpsql block.  I know that we can create using language sql.      Is
> it possible to return an array from the function?  Please guide me.

See the documentation for how to declare a function's return type,
how to return values from a function, and how to build and manipulate
arrays:

http://www.postgresql.org/docs/8.2/interactive/sql-createfunction.html
http://www.postgresql.org/docs/8.2/interactive/plpgsql-overview.html
http://www.postgresql.org/docs/8.2/interactive/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING
http://www.postgresql.org/docs/8.2/interactive/arrays.html
http://www.postgresql.org/docs/8.2/interactive/functions-array.html

If you're having a specific problem then please post the code you're
running and describe how its behavior differs from what you expect.

-- 
Michael Fuhr


pgsql-sql by date:

Previous
From: Karthikeyan Sundaram
Date:
Subject: plpgsql function return array
Next
From: Daniel CAUNE
Date:
Subject: Sequence vs Serial