]> granicus.if.org Git - postgresql/commitdiff
Fix oversight in pg_dump's handling of extension configuration tables.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Feb 2012 20:22:14 +0000 (15:22 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Feb 2012 20:22:36 +0000 (15:22 -0500)
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

index 6afb800a6d1d46487a0e5fc1143787b183bc4b55..fcfc19b966839feac0732ebeef795d9ffd5e315f 100644 (file)
@@ -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)