pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Make new GENERATED-expressions code more bulletproof. 4+ messages / 1 participants [nested] [flat]
* pgsql: Make new GENERATED-expressions code more bulletproof. @ 2023-01-15 18:15 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2023-01-15 18:15 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/3f244d020fbf0b4f01d71e1b7620930be4bf9dc5 Modified Files -------------- src/backend/executor/execUtils.c | 13 +++------ src/backend/executor/nodeModifyTable.c | 2 +- src/include/executor/nodeModifyTable.h | 4 +++ src/test/subscription/t/011_generated.pl | 48 +++++++++++++++++++++++++++----- 4 files changed, 50 insertions(+), 17 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Make new GENERATED-expressions code more bulletproof. @ 2023-01-15 19:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2023-01-15 19:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a8f7687a0b8645697b48cc40fd1a73d455d0c1fc Modified Files -------------- src/backend/executor/execUtils.c | 6 ++-- src/backend/executor/nodeModifyTable.c | 2 +- src/include/executor/nodeModifyTable.h | 4 +++ src/test/subscription/t/011_generated.pl | 48 +++++++++++++++++++++++++++----- 4 files changed, 50 insertions(+), 10 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Make new GENERATED-expressions code more bulletproof. @ 2023-01-15 19:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2023-01-15 19:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a8b88c26f7061689ef1aea1b8fd234fed8e1fc9e Modified Files -------------- src/backend/executor/execUtils.c | 6 ++-- src/backend/executor/nodeModifyTable.c | 2 +- src/include/executor/nodeModifyTable.h | 4 +++ src/test/subscription/t/011_generated.pl | 50 +++++++++++++++++++++++++++----- 4 files changed, 51 insertions(+), 11 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Make new GENERATED-expressions code more bulletproof. @ 2023-01-15 19:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2023-01-15 19:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/787db4be947c2be419c4e97ba9d611708f2523c5 Modified Files -------------- src/backend/executor/execUtils.c | 6 ++-- src/backend/executor/nodeModifyTable.c | 2 +- src/include/executor/nodeModifyTable.h | 4 +++ src/test/subscription/t/011_generated.pl | 50 +++++++++++++++++++++++++++----- 4 files changed, 51 insertions(+), 11 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2023-01-15 19:06 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-01-15 18:15 pgsql: Make new GENERATED-expressions code more bulletproof. Tom Lane <tgl@sss.pgh.pa.us> 2023-01-15 19:06 pgsql: Make new GENERATED-expressions code more bulletproof. Tom Lane <tgl@sss.pgh.pa.us> 2023-01-15 19:06 pgsql: Make new GENERATED-expressions code more bulletproof. Tom Lane <tgl@sss.pgh.pa.us> 2023-01-15 19:06 pgsql: Make new GENERATED-expressions code more bulletproof. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox