Re: Can a function return more then one table? - Mailing list pgsql-general

From Mike Christensen
Subject Re: Can a function return more then one table?
Date
Msg-id CABs1bs1wTRp1vPgJGyuCOwaU-SpSbB+qPLw-YTBA6EtZd1GHrA@mail.gmail.com
Whole thread Raw
In response to Re: Can a function return more then one table?  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
> 2012/1/11 Mike Christensen <mike@kitchenpc.com>:
>> I would like to write a function that returns one row from one table,
>> and about 10 rows or so from another table..
>>
>> Is there a clean way to do this, or am I better off making two separate queries?
>>
>> I'm thinking maybe I can use OUT parameters for the first table, and
>> the return value for the second table?  However, I have no idea what
>> the syntax would be like.
>>
>
> what is possible
>
> * return setof refcursors
> * use arrays instead tables and returns arrays (for tables less 10000 rows)

Thanks!  Both of these options sound feasible, I will play around with
some code and see what I can come up with.

Mike

pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Can a function return more then one table?
Next
From: Filip Rembiałkowski
Date:
Subject: Re: string = any()