postgresql/src/include/tcop
Alvaro Herrera ad08006ba0 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
2018-10-06 19:17:46 -03:00
..
deparse_utility.h Fix event triggers for partitioned tables 2018-10-06 19:17:46 -03:00
dest.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
fastpath.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pquery.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
tcopprot.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
utility.h Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00