postgres.git / summary / log / commit / refs

commit    dd4e0a38781e0c48409f0c092b04b2ec75ed1a7e
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Fri Feb 10 20:22:14 2012 +0000
First released in: 9.2.0, 9.1.3

    Fix oversight in pg_dump's handling of extension configuration tables.
    
    If an extension has not been selected to be dumped (perhaps because of
    a --schema or --table switch), the contents of its configuration tables
    surely should not get dumped either.  Per gripe from
    Hubert Depesz Lubaczewski.


src/bin/pg_dump/pg_dump.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 6afb800a6d1..fcfc19b9668 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -13794,13 +13794,18 @@ getExtensionMembership(ExtensionInfo extinfo[], int numExtensions) */ for (i = 0; i < numExtensions; i++) { - char *extconfig = extinfo[i].extconfig; - char *extcondition = extinfo[i].extcondition; + ExtensionInfo *curext = &(extinfo[i]); + char *extconfig = curext->extconfig; + char *extcondition = curext->extcondition; char **extconfigarray = NULL; char **extconditionarray = NULL; int nconfigitems; int nconditionitems; + /* Tables of not-to-be-dumped extensions shouldn't be dumped */ + if (!curext->dobj.dump) + continue; + if (parsePGArray(extconfig, &extconfigarray, &nconfigitems) && parsePGArray(extcondition, &extconditionarray, &nconditionitems) && nconfigitems == nconditionitems) [parent: e565eff45a7d]