Re: Record returning function accept not matched columns declaration
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: PetSerAl <petseral@gmail.com>,
"pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2024-03-01T17:55:59Z
Lists: pgsql-bugs
Attachments
- v1-fix-record-constant-type-checking.patch (text/x-diff) patch v1
I wrote: > I think we just need to flip things around so that we build the > expected tupdesc from coldeflist if it's present, and only if not do > we examine the expression. The cases this might fail to catch should > all have been handled at parse time in addRangeTableEntryForFunction, > so we don't have to check again. Here's a draft patch that fixes it that way. I'm having mixed feelings about whether to back-patch this. Somebody might complain that we broke a working query in a minor release. Assuming that the visible consequences are all pretty benign, as they seem to be (noting that end-users won't see the assertion failure), maybe the conservative course is to leave it unfixed in stable branches. However, I'm not totally convinced that the consequences are all benign, so there would be a risk on that side. Thoughts? regards, tom lane
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