Re: BUG #16644: null value for defaults in OLD variable for trigger
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Langote <amitlangote09@gmail.com>
Cc: fedor_erastov@mail.ru,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>,
Andres Freund <andres@anarazel.de>,
Andrew Dunstan <andrew@dunslane.net>
Date: 2020-10-26T03:19:04Z
Lists: pgsql-bugs
Amit Langote <amitlangote09@gmail.com> writes: > On Mon, Oct 26, 2020 at 5:53 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: >> Moreover, it's more correct, even disregarding the problem >> at hand, because the tlist isn't a perfectly accurate depiction of >> the relation rowtype: ExecCleanTypeFromTL will not derive the correct >> info for dropped columns. > Hmm, I don't understand. Isn't it the planner's job to make the > targetlist correctly account for dropped columns; what > expand_targetlist() does? Yes, there are columns in the tlist to match them, but ExecCleanTypeFromTL cannot mark those columns as "attisdropped". The column data type likely won't be right either. The latter shouldn't matter, if the column is being filled with a null ... but I'm a bit surprised that we've gotten away this long with not being honest about attisdropped. regards, tom lane
Commits
-
In INSERT/UPDATE, use the table's real tuple descriptor as target.
- 94ec005f334e 12.5 landed
- 8b39345a9d9a 14.0 landed
- 7aeb6404f0aa 13.1 landed
- 20d3fe9009dd 14.0 landed
-
Fix corner case for a BEFORE ROW UPDATE trigger returning OLD.
- de78c10072b3 12.5 landed
- d88d8ad28484 13.1 landed
- ba9f18abd365 14.0 landed
-
Use slots in trigger infrastructure, except for the actual invocation.
- ff11e7f4b9ae 12.0 cited