From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix pg_dump for disabled triggers on partitioned tables
Date: Fri, 16 Jul 2021 21:50:30 +0000
Message-ID: <E1m4Vj4-0001Sp-Vl@gemulon.postgresql.org> (raw)
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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f0e21f2f61675f4e56ae53d32ea54d587a7c2257
Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 94 ++++++++++++++++++++++++++++--
src/bin/pg_dump/pg_dump.h | 1 +
src/bin/pg_dump/t/002_pg_dump.pl | 73 ++++++++++++++++++++---
src/test/regress/expected/sanity_check.out | 2 +
src/test/regress/expected/triggers.out | 5 ++
src/test/regress/sql/triggers.sql | 5 ++
6 files changed, 167 insertions(+), 13 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: alvherre@alvh.no-ip.org
Subject: Re: pgsql: Fix pg_dump for disabled triggers on partitioned tables
In-Reply-To: <E1m4Vj4-0001Sp-Vl@gemulon.postgresql.org>
References: <E1m4Vj4-0001Sp-Vl@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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