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.