Re: Ad hoc SETOF type definition?

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Ad hoc SETOF type definition?
Date: 2023-09-26 18:03:34
Message-ID: 73c7a357-62fe-3274-7f27-7ef9adc3b9b5@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/26/23 12:46, Tom Lane wrote:
> Ron<ronljohnsonjr(at)gmail(dot)com> writes:
>> Is there a way to define the SETOF record on the fly, like you do with
>> RETURNS TABLE (f1 type1, f2 type2)?
> Doesn't RETURNS TABLE meet the need already?

That rationale means that RETURN SETOF is not needed, and can be removed
from Pg, since "RETURNS TABLE meet the need already".

But of course there /are/ times when RETURN SETOF /is/ useful.

So... can ad hoc SETOF definitions be created in the function definition, or
is CREATE TYPE the only way to do it?

--
Born in Arizona, moved to Babylonia.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2023-09-26 18:09:52 Re: Ad hoc SETOF type definition?
Previous Message Tom Lane 2023-09-26 17:46:26 Re: Ad hoc SETOF type definition?