aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeModifyTable.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-10-25 13:57:46 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-10-25 13:57:46 -0400
commitba9f18abd3650e385e9a35df7145a7c38af17e92 (patch)
tree7c937aecdbea729902060fa248ce0c5ae5a642c3 /src/backend/executor/nodeModifyTable.c
parente83c9f913c6197586af8ac53c1d3652db15a3c91 (diff)
downloadpostgresql-ba9f18abd3650e385e9a35df7145a7c38af17e92.tar.gz
postgresql-ba9f18abd3650e385e9a35df7145a7c38af17e92.zip
Fix corner case for a BEFORE ROW UPDATE trigger returning OLD.
If the old row has any "missing" attributes that are supposed to be retrieved from an associated tuple descriptor, the wrong things happened because the trigger result is shoved directly into an executor slot that lacks the missing-attribute data. Notably, CHECK-constraint verification would incorrectly see those columns as NULL, and so would RETURNING-list evaluation. Band-aid around this by forcibly expanding the tuple before passing it to the trigger function. (IMO it was a fundamental misdesign to put the missing-attribute data into tuple constraints, which so much of the system considers to be optional. But we're probably stuck with that now, and will have to continue to apply band-aids as we find other places with similar issues.) Back-patch to v12. v11 would also have the issue, except that commit 920311ab1 already applied a similar band-aid. That forced expansion in more cases than seem really necessary, though, so this isn't a directly equivalent fix. Amit Langote, with some cosmetic changes by me Discussion: https://postgr.es/m/16644-5da7ef98a7ac4545@postgresql.org
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
0 files changed, 0 insertions, 0 deletions