Appetite for syntactic sugar to match result set columns to UDT fields? - Mailing list pgsql-hackers

From David G. Johnston
Subject Appetite for syntactic sugar to match result set columns to UDT fields?
Date
Msg-id CAKFQuwaNf4Zc3XV0Zy_MUA2AobJ2+=K8_+iLUY31fuQXgwcbag@mail.gmail.com
Whole thread Raw
In response to Appetite for syntactic sugar to match result set columns to UDT fields?  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
On Thursday, September 4, 2025, Philip Warner <pjw@rhyme.com.au> wrote:

The Solution

Some syntax like:

    SELECT CAST((F1=> value1, F2 => value2) AS FOO BY NAME)

or

    SELECT FOO(F1 => VALUE1, F2=> value2);

or some other well-defined and non-conflicting syntax.


Don’t really see the point of new syntax here - both things you wrote are already effectively syntactically valid if a user-defined function exists; and it’s a cleaner interface.  Plus, the serialized form of a composite doesn’t include field names so giving those names special treatment elsewhere feels excessive.

Expanding cast with custom features seems particularly undesirable.

David J.

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Logical Replication of sequences
Next
From: Alyona Vinter
Date:
Subject: Re: Resetting recovery target parameters in pg_createsubscriber