aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeModifyTable.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-01-15 14:06:46 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2023-01-15 14:06:46 -0500
commit787db4be947c2be419c4e97ba9d611708f2523c5 (patch)
treee5008dcf5b63edfae5fb053ac8c2424d9df34e11 /src/backend/executor/nodeModifyTable.c
parentc159b0383fa6412686abfb4e6de9face87d2b0cc (diff)
downloadpostgresql-787db4be947c2be419c4e97ba9d611708f2523c5.tar.gz
postgresql-787db4be947c2be419c4e97ba9d611708f2523c5.zip
Make new GENERATED-expressions code more bulletproof.
In commit 8bf6ec3ba I assumed that no code path could reach ExecGetExtraUpdatedCols without having gone through ExecInitStoredGenerated. That turns out not to be the case in logical replication: if there's an ON UPDATE trigger on the target table, trigger.c will call this code before anybody has set up its generated columns. Having seen that, I don't have a lot of faith in there not being other such paths. ExecGetExtraUpdatedCols can call ExecInitStoredGenerated for itself, as long as we are willing to assume that it is only called in CMD_UPDATE operations, which on the whole seems like a safer leap of faith. Per report from Vitaly Davydov. Discussion: https://postgr.es/m/d259d69652b8c2ff50e14cda3c236c7f@postgrespro.ru
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
-rw-r--r--src/backend/executor/nodeModifyTable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c
index 74ef7ce5d9c..eac9291149e 100644
--- a/src/backend/executor/nodeModifyTable.c
+++ b/src/backend/executor/nodeModifyTable.c
@@ -257,7 +257,7 @@ ExecCheckTIDVisible(EState *estate,
* (Currently, ri_extraUpdatedCols is consulted only in UPDATE, but we might
* as well fill it for INSERT too.)
*/
-static void
+void
ExecInitStoredGenerated(ResultRelInfo *resultRelInfo,
EState *estate,
CmdType cmdtype)