pgsql: Correctly handle owned sequences with extensions

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Correctly handle owned sequences with extensions
Date: 2016-07-31 14:57:20
Message-ID: E1bTsB6-0001Fc-F9@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Correctly handle owned sequences with extensions

With the refactoring of pg_dump to handle components, getOwnedSeqs needs
to be a bit more intelligent regarding which components to dump when.
Specifically, we can't simply use the owning table's components as the
set of components to dump as the table might only be including certain
components while all components of the sequence should be dumped, for
example, when the table is a member of an extension while the sequence
is not.

Handle this by combining the set of components to be dumped for the
sequence explicitly and those to be dumped for the table when setting
the components to be dumped for the sequence.

Also add a number of regression tests around this to, hopefully, catch
any future changes which break the expected behavior.

Discovered by: Philippe BEAUDOIN
Reviewed by: Michael Paquier

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/f9e439b1ca81e3305b677d93c67299549625370c

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 27 ++++++--
src/bin/pg_dump/t/002_pg_dump.pl | 50 +++++++++++++
src/test/modules/test_pg_dump/t/001_base.pl | 81 +++++++++++++++++++++-
.../modules/test_pg_dump/test_pg_dump--1.0.sql | 6 +-
4 files changed, 155 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-07-31 20:05:32 pgsql: Code review for tqueue.c: fix memory leaks, speed it up, other f
Previous Message Bruce Momjian 2016-07-31 01:34:32 pgsql: doc: improve wording of Error Message Style Guide