diff options
author | Michael Paquier <michael@paquier.xyz> | 2018-11-05 11:04:20 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2018-11-05 11:04:20 +0900 |
commit | 8aad248f7c67f1225027414530ce2809c1fcd104 (patch) | |
tree | 3fcd42dd091be1833bacedcc95d87b46015da55d /src/backend/commands/constraint.c | |
parent | 70c38e7080128e27cb6b9e20237f2c36807b0000 (diff) |
Block creation of partitions with open references to its parent
When a partition is created as part of a trigger processing, it is
possible that the partition which just gets created changes the
properties of the table the executor of the ongoing command relies on,
causing a subsequent crash. This has been found possible when for
example using a BEFORE INSERT which creates a new partition for a
partitioned table being inserted to.
Any attempt to do so is blocked when working on a partition, with
regression tests added for both CREATE TABLE PARTITION OF and ALTER
TABLE ATTACH PARTITION.
Reported-by: Dmitry Shalashov
Author: Amit Langote
Reviewed-by: Michael Paquier, Tom Lane
Discussion: https://postgr.es/m/15437-3fe01ee66bd1bae1@postgresql.org
Backpatch-through: 10
Diffstat (limited to 'src/backend/commands/constraint.c')
0 files changed, 0 insertions, 0 deletions