summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2011-05-25 20:26:45 +0000
committerTom Lane2011-05-25 20:27:22 +0000
commit7b158d1baed859971c1aa792bff6a7e1f721cf91 (patch)
tree83a96a08654cd373db86fe1846ac6747d6065449
parent3439e40f9afa5e8702c8e3e7d0b09a0cb4b07e73 (diff)
Suppress extensions in partial dumps.
We initially had pg_dump emit CREATE EXTENSION commands unconditionally. However, pg_dump has long been in the habit of not dumping procedural language definitions when a --schema or --table switch is given. It seems appropriate to handle extensions the same way, since like PLs they are SQL objects that are not in any particular schema. Per complaint from Adrian Schreyer.
-rw-r--r--src/bin/pg_dump/pg_dump.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 80bc9a96cad..f925be1ffaf 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -1153,10 +1153,11 @@ selectDumpableDefaultACL(DefaultACLInfo *dinfo)
* selectDumpableExtension: policy-setting subroutine
* Mark an extension as to be dumped or not
*
- * Normally, we just dump all extensions. However, in binary-upgrade mode
- * it's necessary to skip built-in extensions, since we assume those will
- * already be installed in the target database. We identify such extensions
- * by their having OIDs in the range reserved for initdb.
+ * Normally, we dump all extensions, or none of them if include_everything
+ * is false (i.e., a --schema or --table switch was given). However, in
+ * binary-upgrade mode it's necessary to skip built-in extensions, since we
+ * assume those will already be installed in the target database. We identify
+ * such extensions by their having OIDs in the range reserved for initdb.
*/
static void
selectDumpableExtension(ExtensionInfo *extinfo)
@@ -1164,7 +1165,7 @@ selectDumpableExtension(ExtensionInfo *extinfo)
if (binary_upgrade && extinfo->dobj.catId.oid < (Oid) FirstNormalObjectId)
extinfo->dobj.dump = false;
else
- extinfo->dobj.dump = true;
+ extinfo->dobj.dump = include_everything;
}
/*