Re: Appetite for syntactic sugar to match result set columns to UDT fields?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Appetite for syntactic sugar to match result set columns to UDT fields?
Date: 2025-09-05 05:54:56
Message-ID: 1308528.1757051696@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> The Problem
> Currently, if one has:
> Create Type FOO(
> VALUE1 Int,
> VALUE2 Int);
> And one has a query:
> Select F1, F2 from A_TABLE;
> One can return the rows, or one can create a row object and cast it to
> FOO type.

I'm kind of wondering where is the connection between type FOO and
table A_TABLE?

Once you have the table, there is already a perfectly good composite
type A_TABLE that you could use without any worries about whether it
matches the table. So I'm not following why introducing FOO adds
anything of value.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2025-09-05 06:01:27 Re: Conflict detection for update_deleted in logical replication
Previous Message Alyona Vinter 2025-09-05 05:51:12 Re: Resetting recovery target parameters in pg_createsubscriber