Allow pg_dump to dump non-extension members of an extension-owned schema.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 8 Sep 2016 17:12:01 +0000 (13:12 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 8 Sep 2016 17:12:01 +0000 (13:12 -0400)
commit31eb14504de311c98db2d1306ac61427bcdad863
tree52f4f09abdd0ba6eca7b7d2250a1f276dcc239af
parenta88cee90fdfb2c125d56cb08164ca9a9ca39a75d
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@2ndquadrant.com>
src/bin/pg_dump/pg_dump.c
src/test/modules/test_pg_dump/t/001_base.pl
src/test/modules/test_pg_dump/test_pg_dump--1.0.sql