diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-02-10 15:22:14 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-02-10 15:22:36 -0500 |
commit | dd4e0a38781e0c48409f0c092b04b2ec75ed1a7e (patch) | |
tree | f01dc2d7cf51a5a6f6c22c9512882d30795e4dab | |
parent | e565eff45a7d2cec6148cb5942d24ad0ebfbb1af (diff) |
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.
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 9 |
1 files 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) |