pgsql: Fix event triggers for partitioned tables

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема pgsql: Fix event triggers for partitioned tables
Дата
Msg-id E1g8uuM-000571-DW@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix event triggers for partitioned tables

Index DDL cascading on partitioned tables introduced a way for ALTER
TABLE to be called reentrantly.  This caused an an important deficiency
in event trigger support to be exposed: on exiting the reentrant call,
the alter table state object was clobbered, causing a crash when the
outer alter table tries to finalize its processing.  Fix the crash by
creating a stack of event trigger state objects.  There are still ways
to cause things to misbehave (and probably other crashers) with more
elaborate tricks, but at least it now doesn't crash in the obvious
scenario.

Backpatch to 9.5, where DDL deparsing of event triggers was introduced.

Reported-by: Marco Slot
Authors: Michaël Paquier, Álvaro Herrera
Discussion: https://postgr.es/m/CANNhMLCpi+HQ7M36uPfGbJZEQLyTy7XvX=5EFkpR-b1bo0uJew@mail.gmail.com

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a2a5159ed678f0e4a0efa7e8aabbd4c03eb36843

Modified Files
--------------
src/backend/catalog/index.c          |  8 +++++++-
src/backend/commands/event_trigger.c | 13 +++++++------
src/backend/commands/indexcmds.c     |  3 ++-
src/backend/commands/tablecmds.c     |  2 +-
src/backend/commands/view.c          |  4 ++++
src/include/catalog/index.h          |  3 ++-
src/include/tcop/deparse_utility.h   |  3 +++
7 files changed, 26 insertions(+), 10 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Restore sane locking behavior during parallel query.
Следующее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Fix catalog insertion order for ATTACH PARTITION