pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Karthikeyan Sundaram <skarthi98@hotmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: plpgsql function return array
Date: Sat, 31 Mar 2007 06:55:46 -0600
Message-ID: <20070331125546.GA23812@winnie.fuhr.org> (raw)
In-Reply-To: <BAY131-W33EEDD194983C9790C659B0620@phx.gbl>
References: <BAY131-W33EEDD194983C9790C659B0620@phx.gbl>

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-RE...
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



view thread (2+ messages)

Message-ID: <20070331125546.GA23812@winnie.fuhr.org>
Permalink:  ../20070331125546.GA23812@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20070331125546.GA23812@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, skarthi98@hotmail.com
  Subject: Re: plpgsql function return array
  In-Reply-To: <20070331125546.GA23812@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox