pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Don't throw an error if a queued AFTER trigger no longer exists. 6+ messages / 1 participants [nested] [flat]
* pgsql: Don't throw an error if a queued AFTER trigger no longer exists. @ 2024-06-20 18:21 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2024-06-20 18:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't throw an error if a queued AFTER trigger no longer exists. afterTriggerInvokeEvents and AfterTriggerExecute have always treated it as an error if the trigger OID mentioned in a queued after-trigger event can't be found. However, that fails to account for the edge case where the trigger's been dropped in the current transaction since queueing the event. There seems no very good reason to disallow that case, so instead silently do nothing if the trigger OID can't be found. This does give up a little bit of bug-detection ability, but I don't recall that these error messages have ever actually revealed a bug, so it seems mostly theoretical. Alternatives such as marking pending events DONE at the time of dropping a trigger would be complicated and perhaps introduce bugs of their own. Per bug #18517 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/18517-af2d19882240902c@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e6d0d16adf7fb7e715314d5068db4b875c3edf00 Modified Files -------------- src/backend/commands/trigger.c | 12 +++++++----- src/test/regress/expected/triggers.out | 11 +++++++++++ src/test/regress/sql/triggers.sql | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't throw an error if a queued AFTER trigger no longer exists. @ 2024-06-20 18:21 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2024-06-20 18:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't throw an error if a queued AFTER trigger no longer exists. afterTriggerInvokeEvents and AfterTriggerExecute have always treated it as an error if the trigger OID mentioned in a queued after-trigger event can't be found. However, that fails to account for the edge case where the trigger's been dropped in the current transaction since queueing the event. There seems no very good reason to disallow that case, so instead silently do nothing if the trigger OID can't be found. This does give up a little bit of bug-detection ability, but I don't recall that these error messages have ever actually revealed a bug, so it seems mostly theoretical. Alternatives such as marking pending events DONE at the time of dropping a trigger would be complicated and perhaps introduce bugs of their own. Per bug #18517 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/18517-af2d19882240902c@postgresql.org Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4f196667627055ce7c6b3e8d3e9a4f5f6a906b86 Modified Files -------------- src/backend/commands/trigger.c | 12 +++++++----- src/test/regress/expected/triggers.out | 11 +++++++++++ src/test/regress/sql/triggers.sql | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't throw an error if a queued AFTER trigger no longer exists. @ 2024-06-20 18:21 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2024-06-20 18:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't throw an error if a queued AFTER trigger no longer exists. afterTriggerInvokeEvents and AfterTriggerExecute have always treated it as an error if the trigger OID mentioned in a queued after-trigger event can't be found. However, that fails to account for the edge case where the trigger's been dropped in the current transaction since queueing the event. There seems no very good reason to disallow that case, so instead silently do nothing if the trigger OID can't be found. This does give up a little bit of bug-detection ability, but I don't recall that these error messages have ever actually revealed a bug, so it seems mostly theoretical. Alternatives such as marking pending events DONE at the time of dropping a trigger would be complicated and perhaps introduce bugs of their own. Per bug #18517 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/18517-af2d19882240902c@postgresql.org Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1424c7abc44fcb61f6a2a63f7d163670ba3250be Modified Files -------------- src/backend/commands/trigger.c | 12 +++++++----- src/test/regress/expected/triggers.out | 11 +++++++++++ src/test/regress/sql/triggers.sql | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't throw an error if a queued AFTER trigger no longer exists. @ 2024-06-20 18:21 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2024-06-20 18:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't throw an error if a queued AFTER trigger no longer exists. afterTriggerInvokeEvents and AfterTriggerExecute have always treated it as an error if the trigger OID mentioned in a queued after-trigger event can't be found. However, that fails to account for the edge case where the trigger's been dropped in the current transaction since queueing the event. There seems no very good reason to disallow that case, so instead silently do nothing if the trigger OID can't be found. This does give up a little bit of bug-detection ability, but I don't recall that these error messages have ever actually revealed a bug, so it seems mostly theoretical. Alternatives such as marking pending events DONE at the time of dropping a trigger would be complicated and perhaps introduce bugs of their own. Per bug #18517 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/18517-af2d19882240902c@postgresql.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/88f3baa06afd45510ecef743e11443740b678156 Modified Files -------------- src/backend/commands/trigger.c | 12 +++++++----- src/test/regress/expected/triggers.out | 11 +++++++++++ src/test/regress/sql/triggers.sql | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't throw an error if a queued AFTER trigger no longer exists. @ 2024-06-20 18:21 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2024-06-20 18:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't throw an error if a queued AFTER trigger no longer exists. afterTriggerInvokeEvents and AfterTriggerExecute have always treated it as an error if the trigger OID mentioned in a queued after-trigger event can't be found. However, that fails to account for the edge case where the trigger's been dropped in the current transaction since queueing the event. There seems no very good reason to disallow that case, so instead silently do nothing if the trigger OID can't be found. This does give up a little bit of bug-detection ability, but I don't recall that these error messages have ever actually revealed a bug, so it seems mostly theoretical. Alternatives such as marking pending events DONE at the time of dropping a trigger would be complicated and perhaps introduce bugs of their own. Per bug #18517 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/18517-af2d19882240902c@postgresql.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9ce8ee9d3e75d673e32c862fac27152aeeb77137 Modified Files -------------- src/backend/commands/trigger.c | 12 +++++++----- src/test/regress/expected/triggers.out | 11 +++++++++++ src/test/regress/sql/triggers.sql | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't throw an error if a queued AFTER trigger no longer exists. @ 2024-06-20 18:21 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2024-06-20 18:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't throw an error if a queued AFTER trigger no longer exists. afterTriggerInvokeEvents and AfterTriggerExecute have always treated it as an error if the trigger OID mentioned in a queued after-trigger event can't be found. However, that fails to account for the edge case where the trigger's been dropped in the current transaction since queueing the event. There seems no very good reason to disallow that case, so instead silently do nothing if the trigger OID can't be found. This does give up a little bit of bug-detection ability, but I don't recall that these error messages have ever actually revealed a bug, so it seems mostly theoretical. Alternatives such as marking pending events DONE at the time of dropping a trigger would be complicated and perhaps introduce bugs of their own. Per bug #18517 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/18517-af2d19882240902c@postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b0037bbefda3339c821ff4b5d04d672274bf7238 Modified Files -------------- src/backend/commands/trigger.c | 16 +++++++++------- src/test/regress/expected/triggers.out | 11 +++++++++++ src/test/regress/sql/triggers.sql | 14 ++++++++++++++ 3 files changed, 34 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2024-06-20 18:21 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-06-20 18:21 pgsql: Don't throw an error if a queued AFTER trigger no longer exists. Tom Lane <tgl@sss.pgh.pa.us> 2024-06-20 18:21 pgsql: Don't throw an error if a queued AFTER trigger no longer exists. Tom Lane <tgl@sss.pgh.pa.us> 2024-06-20 18:21 pgsql: Don't throw an error if a queued AFTER trigger no longer exists. Tom Lane <tgl@sss.pgh.pa.us> 2024-06-20 18:21 pgsql: Don't throw an error if a queued AFTER trigger no longer exists. Tom Lane <tgl@sss.pgh.pa.us> 2024-06-20 18:21 pgsql: Don't throw an error if a queued AFTER trigger no longer exists. Tom Lane <tgl@sss.pgh.pa.us> 2024-06-20 18:21 pgsql: Don't throw an error if a queued AFTER trigger no longer exists. 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