pgsql: Allow pg_dump to dump non-extension members of an extension-owne

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow pg_dump to dump non-extension members of an extension-owne
Date: 2016-09-08 17:12:15
Message-ID: E1bi2s3-00069i-SG@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow pg_dump to dump non-extension members of an extension-owned schema.

Previously, if a schema was created by an extension, a normal pg_dump run
(not --binary-upgrade) would summarily skip every object in that schema.
In a case where an extension creates a schema and then users create other
objects within that schema, this does the wrong thing: we want pg_dump
to skip the schema but still create the non-extension-owned objects.

There's no easy way to fix this pre-9.6, because in earlier versions the
"dump" status for a schema is just a bool and there's no way to distinguish
"dump me" from "dump my members". However, as of 9.6 we do have enough
state to represent that, so this is a simple correction of the logic in
selectDumpableNamespace.

In passing, make some cosmetic fixes in nearby code.

Martín Marqués, reviewed by Michael Paquier

Discussion: <99581032-71de-6466-c325-069861f1947d(at)2ndquadrant(dot)com>

Branch
------
master

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

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 28 ++-
src/test/modules/test_pg_dump/t/001_base.pl | 206 ++++++++++++++++++++-
.../modules/test_pg_dump/test_pg_dump--1.0.sql | 24 +++
3 files changed, 247 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2016-09-08 17:40:11 pgsql: Fix two src/test/modules Makefiles
Previous Message Tom Lane 2016-09-08 16:48:33 Re: Re: [COMMITTERS] pgsql: Make initdb's suggested "pg_ctl start" command line more reliabl