pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Block creation of partitions with open references to its parent 3+ messages / 1 participants [nested] [flat]
* pgsql: Block creation of partitions with open references to its parent @ 2018-11-05 02:05 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 3+ messages in thread From: Michael Paquier @ 2018-11-05 02:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7c222d5e56cca4e2081dc7841ed118a97666cb8e Modified Files -------------- src/backend/commands/tablecmds.c | 8 ++++++++ src/test/regress/expected/alter_table.out | 18 ++++++++++++++++++ src/test/regress/expected/create_table.out | 16 ++++++++++++++++ src/test/regress/sql/alter_table.sql | 16 ++++++++++++++++ src/test/regress/sql/create_table.sql | 14 ++++++++++++++ 5 files changed, 72 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Block creation of partitions with open references to its parent @ 2018-11-05 02:05 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 3+ messages in thread From: Michael Paquier @ 2018-11-05 02:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/8aad248f7c67f1225027414530ce2809c1fcd104 Modified Files -------------- src/backend/commands/tablecmds.c | 8 ++++++++ src/test/regress/expected/alter_table.out | 18 ++++++++++++++++++ src/test/regress/expected/create_table.out | 16 ++++++++++++++++ src/test/regress/sql/alter_table.sql | 16 ++++++++++++++++ src/test/regress/sql/create_table.sql | 14 ++++++++++++++ 5 files changed, 72 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Block creation of partitions with open references to its parent @ 2018-11-05 02:05 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 3+ messages in thread From: Michael Paquier @ 2018-11-05 02:05 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/dc3e436b191a8f8d6f35fad952dd3dc314ccabf9 Modified Files -------------- src/backend/commands/tablecmds.c | 8 ++++++++ src/test/regress/expected/alter_table.out | 18 ++++++++++++++++++ src/test/regress/expected/create_table.out | 16 ++++++++++++++++ src/test/regress/sql/alter_table.sql | 16 ++++++++++++++++ src/test/regress/sql/create_table.sql | 14 ++++++++++++++ 5 files changed, 72 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2018-11-05 02:05 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-11-05 02:05 pgsql: Block creation of partitions with open references to its parent Michael Paquier <michael@paquier.xyz> 2018-11-05 02:05 pgsql: Block creation of partitions with open references to its parent Michael Paquier <michael@paquier.xyz> 2018-11-05 02:05 pgsql: Block creation of partitions with open references to its parent Michael Paquier <michael@paquier.xyz>
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