Re: Record returning function accept not matched columns declaration
David G. Johnston <david.g.johnston@gmail.com>
From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PetSerAl <petseral@gmail.com>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2024-02-29T21:55:55Z
Lists: pgsql-bugs
On Thu, Feb 29, 2024 at 2:31 PM David G. Johnston < david.g.johnston@gmail.com> wrote: > > Polymorphic functions do not require a column definition list. The > non-polymorphic function signature does require the column definition > list. That we accept a column definition list in the polymorphic case is > settled code but seems like it led to this bug. > > Hit send too soon... I suppose this entire query form is basically a hack around the fact that we have no syntax to directly assign names to the fields of an "anonymous record type" literal. with a(b) as (values (row(1,2,3))) select (a.b).* from a; ERROR: record type has not been registered Though oddly this doesn't seem to be universal: with a(b) as (values (row(1,2,3))) select (row(c.*)).* from a, coalesce(a.b) as c (d int, e int, f int); f1, f2, and f3 end up being the output field names... David J.
Commits
-
Fix type-checking of RECORD-returning functions in FROM.
- d769f9d97feb 13.15 landed
- a595c3075fb4 14.12 landed
- 466376c9f848 12.19 landed
- 3b671dcf53d1 15.7 landed
- 2ed8f9a01e74 17.0 landed
- 1b3029be5df0 16.3 landed