diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2023-01-15 13:14:52 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2023-01-15 13:14:52 -0500 |
commit | 3f244d020fbf0b4f01d71e1b7620930be4bf9dc5 (patch) | |
tree | 941495daeaea577e987eaaea98bce0b7f868a811 /src/include/executor/nodeModifyTable.h | |
parent | 1334b79a359fb842d2d3cfe5b61ad4ccff8b82a4 (diff) | |
download | postgresql-3f244d020fbf0b4f01d71e1b7620930be4bf9dc5.tar.gz postgresql-3f244d020fbf0b4f01d71e1b7620930be4bf9dc5.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/include/executor/nodeModifyTable.h')
-rw-r--r-- | src/include/executor/nodeModifyTable.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/executor/nodeModifyTable.h b/src/include/executor/nodeModifyTable.h index 37344141e0b..e7eeb307d0f 100644 --- a/src/include/executor/nodeModifyTable.h +++ b/src/include/executor/nodeModifyTable.h @@ -15,6 +15,10 @@ #include "nodes/execnodes.h" +extern void ExecInitStoredGenerated(ResultRelInfo *resultRelInfo, + EState *estate, + CmdType cmdtype); + extern void ExecComputeStoredGenerated(ResultRelInfo *resultRelInfo, EState *estate, TupleTableSlot *slot, CmdType cmdtype); |