On Tue, Sep 26, 2023 at 1:15 PM Tom Lane wrote
> it clear that the type exists independently of the function. (Our
> behavior of automatically making composite types for tables seems to
> me to have been a rather unfortunate choice.)
>
I really like this behavior and exploit it heavily, in orde
On 9/26/23 16:29, Adrian Klaver wrote:
[snip]
As a very simple example:
This is EXACTLY what I was looking for. Thank you.
create table source(id integer, fld_1 varchar);
insert into source values (1, 'cat'), (2, 'dog'), (3, 'fish');
CREATE OR REPLACE FUNCTION public.table_return(multipli
On 9/26/23 13:29, Adrian Klaver wrote:
On 9/26/23 12:30, Ron wrote:
On 9/26/23 13:15, Tom Lane wrote:
Ron 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 exac
On 9/26/23 12:30, Ron wrote:
On 9/26/23 13:15, Tom Lane wrote:
Ron 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
On 9/26/23 13:15, Tom Lane wrote:
Ron writes:
On 9/26/23 12:46, Tom Lane wrote:
Ron 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
Ron writes:
> On 9/26/23 12:46, Tom Lane wrote:
>> Ron 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 re
On 9/26/23 11:03 AM, Ron wrote:
On 9/26/23 12:46, Tom Lane wrote:
Ron 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 ca
On 9/26/23 12:46, Tom Lane wrote:
Ron 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 "RETU
Ron 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?
regards, tom lane
Pg 9.6.24 (Yes, I know it's EOL.)
This simple "programming example" function works perfectly. However, it
requires me to create the TYPE "foo".
CREATE TYPE foo AS (tab_name TEXT, num_pages INT);
CREATE FUNCTION dba.blarge()
RETURNS SETOF foo
LANGUAGE plpgsql
AS
$$
DECLARE
10 matches
Mail list logo