Re: Ad hoc SETOF type definition?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Ad hoc SETOF type definition?
Date: 2023-09-26 20:29:23
Message-ID: 538ed08d-55ba-4a51-8e46-4e424aaebb3c@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/26/23 12:30, Ron wrote:
> On 9/26/23 13:15, Tom Lane wrote:
>> Ron <ronljohnsonjr(at)gmail(dot)com> writes:
>>> On 9/26/23 12:46, Tom Lane wrote:

>> I'm not really sure what functionality you think is missing from RETURNS
>> TABLE, granting that you do want to return a set of rows and not exactly
>> one row.
>
> There might be some other logic in the body of the FOR loop that is not
> practical to embed in the body of the SELECT statement.

I think you are conflating RETURNS TABLE and RETURN QUERY. You can build
a 'TABLE' from variables outside of a query.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2023-09-26 21:29:46 Re: Ad hoc SETOF type definition?
Previous Message Maciek Sakrejda 2023-09-26 19:43:54 Re: log_statement vs log_min_duration_statement