]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix pg_dump for disabled triggers on partitioned tables
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 16 Jul 2021 21:29:22 +0000 (17:29 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 16 Jul 2021 21:29:22 +0000 (17:29 -0400)
commit3c5b7c6286215de41ba0a327d065876ff8bc26b2
tree5df5e29ae756bb759a8ca0daebcf1c19f2491c06
parenteef92de11e50837e4a0d02fc7269fdba7c97e583
Fix pg_dump for disabled triggers on partitioned tables

pg_dump failed to preserve the 'enabled' flag (which can be not only
disabled, but also REPLICA or ALWAYS) for partitions which had it
changed from their respective parents.  Attempt to handle that by
including a definition for such triggers in the dump, but replace the
standard CREATE TRIGGER line with an ALTER TRIGGER line.

Backpatch to 11, where these triggers can exist.  In branches 11 and 12,
pick up a few test lines from commit b9b408c48724 to verify that
pg_upgrade is okay with these arrangements.

Co-authored-by: Justin Pryzby <pryzby@telsasoft.com>
Co-authored-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/20200930223450.GA14848@telsasoft.com
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.h
src/bin/pg_dump/t/002_pg_dump.pl
src/test/regress/expected/sanity_check.out
src/test/regress/expected/triggers.out
src/test/regress/sql/triggers.sql