pgsql: Fix SET CONSTRAINTS .. DEFERRED on partitioned tables

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема pgsql: Fix SET CONSTRAINTS .. DEFERRED on partitioned tables
Дата
Msg-id E1iSla7-0005iM-VP@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix SET CONSTRAINTS .. DEFERRED on partitioned tables

SET CONSTRAINTS ... DEFERRED failed on partitioned tables, because of a
sanity check that ensures that the affected constraints have triggers.
On partitioned tables, the triggers are in the leaf partitions, not in
the partitioned relations themselves, so the sanity check fails.
Removing the sanity check solves the problem, because the code needed to
support the case is already there.

Backpatch to 11.

Note: deferred unique constraints are not affected by this bug, because
they do have triggers in the parent partitioned table.  I did not add a
test for this scenario.

Discussion: https://postgr.es/m/20191105212915.GA11324@alvherre.pgsql

Branch
------
master

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

Modified Files
--------------
src/backend/commands/trigger.c            | 10 ------
src/test/regress/expected/foreign_key.out | 56 +++++++++++++++++++++++++++++--
src/test/regress/sql/foreign_key.sql      | 45 ++++++++++++++++++++++++-
3 files changed, 97 insertions(+), 14 deletions(-)


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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: pgsql: doc: Further clarify how recovery target parameters are applied
Следующее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Fix SET CONSTRAINTS .. DEFERRED on partitioned tables