Re: Appetite for syntactic sugar to match result set columns to UDT fields?
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Philip Warner <pjw@rhyme.com.au>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-09-05T05:54:56Z
Lists: pgsql-hackers
Philip Warner <pjw@rhyme.com.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