Re: Function returning setof more than 1 table

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "J S B" <jsbali(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Function returning setof more than 1 table
Date: 2006-10-27 17:10:26
Message-ID: b42b73150610271010j2724fac0l7974e4f23dcd2852@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/27/06, J S B <jsbali(at)gmail(dot)com> wrote:
> Can I have a function (language sql) returning SETOF more than one table?
>
> Thanks,
> Jas

no, but you can return a record of refcursors. note this is plpgsql.
if you are willing to bend on the language, you will find refcursors
to be pretty cool, you can pass them to other functions, kind of
like handles to query results.

in pure sql, you pretty much have to write to temp tables. make sure
you create the temp table before you run the function...

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2006-10-27 17:32:36 Re: Send email from PostgreSQL, may I ?
Previous Message Tony Caduto 2006-10-27 17:09:57 Re: Send email from PostgreSQL, may I ?