pgsql: Don't throw an error if a queued AFTER trigger no longer exists.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Don't throw an error if a queued AFTER trigger no longer exists.
Дата
Msg-id E1sKMPw-002K93-FL@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: pg_combinebackup: Fix small mistake in --help output
Следующее
От: Bruce Momjian
Дата:
Сообщение: pgsql: doc PG 17 relnotes: remove mention of undocumented GUC