From skarthi98@hotmail.com Sat Mar 31 07:43:51 2007 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 4ABCB9FB303; Sat, 31 Mar 2007 04:43:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 29824-06; Sat, 31 Mar 2007 04:43:59 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from bay0-omc3-s2.bay0.hotmail.com (bay0-omc3-s2.bay0.hotmail.com [65.54.246.202]) by postgresql.org (Postfix) with ESMTP id A7C299FB2FD; Sat, 31 Mar 2007 04:43:45 -0300 (ADT) Received: from BAY131-W3 ([65.55.136.38]) by bay0-omc3-s2.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Sat, 31 Mar 2007 00:43:44 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_c29f5318-d02b-4969-b14a-a0df408349aa_" X-Originating-IP: [67.169.184.232] From: Karthikeyan Sundaram To: , Subject: plpgsql function return array Date: Sat, 31 Mar 2007 00:43:44 -0700 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 31 Mar 2007 07:43:44.0473 (UTC) FILETIME=[4F216490:01C77368] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.743 tagged_above=0 required=5 tests=AWL=-0.921, BAYES_20=-0.74, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, HTML_40_50=0.496, HTML_MESSAGE=0.001, SPF_PASS=-0.001 X-Spam-Level: X-Archive-Number: 200703/240 X-Sequence-Number: 25064 --_c29f5318-d02b-4969-b14a-a0df408349aa_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I am using Postgres 8.1.0. I have a requirement. I will create a f= unction 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 f= rom the function? Please guide me. Regardsskarthi _________________________________________________________________ Take a break and play crossword puzzles - FREE! http://games.msn.com/en/flexicon/default.htm?icid=3Dflexicon_ wlmemailtagli= nemarch07= --_c29f5318-d02b-4969-b14a-a0df408349aa_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi,
 
    I am using Postgres 8.1.0.  I have= a requirement. I will create a function accepting few parameters.  Th= is 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 l= anguage sql.
 
    Is it possible to return an a= rray from the function?  Please guide me.
 
 
Regar= ds
skarthi



Take a break and play crossword puzzles - = FREE! Play Now! = --_c29f5318-d02b-4969-b14a-a0df408349aa_-- From mike@fuhr.org Sat Mar 31 12:56:01 2007 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 129259FB3EB for ; Sat, 31 Mar 2007 09:56:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 97463-05 for ; Sat, 31 Mar 2007 09:55:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 7774F9FB30F for ; Sat, 31 Mar 2007 09:55:55 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.8/8.13.8) with ESMTP id l2VCtljT002080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 31 Mar 2007 06:55:50 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.8/8.13.8) with ESMTP id l2VCtkvB023872; Sat, 31 Mar 2007 06:55:46 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.8/8.13.8/Submit) id l2VCtkdA023871; Sat, 31 Mar 2007 06:55:46 -0600 (MDT) (envelope-from mfuhr) Date: Sat, 31 Mar 2007 06:55:46 -0600 From: Michael Fuhr To: Karthikeyan Sundaram Cc: pgsql-sql@postgresql.org Subject: Re: plpgsql function return array Message-ID: <20070331125546.GA23812@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/362 X-Sequence-Number: 28000 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