Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dd4e0a3

Browse files
committed
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.
1 parent e565eff commit dd4e0a3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13794,13 +13794,18 @@ getExtensionMembership(ExtensionInfo extinfo[], int numExtensions)
1379413794
*/
1379513795
for (i = 0; i < numExtensions; i++)
1379613796
{
13797-
char *extconfig = extinfo[i].extconfig;
13798-
char *extcondition = extinfo[i].extcondition;
13797+
ExtensionInfo *curext = &(extinfo[i]);
13798+
char *extconfig = curext->extconfig;
13799+
char *extcondition = curext->extcondition;
1379913800
char **extconfigarray = NULL;
1380013801
char **extconditionarray = NULL;
1380113802
int nconfigitems;
1380213803
int nconditionitems;
1380313804

13805+
/* Tables of not-to-be-dumped extensions shouldn't be dumped */
13806+
if (!curext->dobj.dump)
13807+
continue;
13808+
1380413809
if (parsePGArray(extconfig, &extconfigarray, &nconfigitems) &&
1380513810
parsePGArray(extcondition, &extconditionarray, &nconditionitems) &&
1380613811
nconfigitems == nconditionitems)

0 commit comments

Comments
 (0)