Commit 7b158d1b authored by Tom Lane's avatar Tom Lane

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.
parent 3439e40f
...@@ -1153,10 +1153,11 @@ selectDumpableDefaultACL(DefaultACLInfo *dinfo) ...@@ -1153,10 +1153,11 @@ selectDumpableDefaultACL(DefaultACLInfo *dinfo)
* selectDumpableExtension: policy-setting subroutine * selectDumpableExtension: policy-setting subroutine
* Mark an extension as to be dumped or not * Mark an extension as to be dumped or not
* *
* Normally, we just dump all extensions. However, in binary-upgrade mode * Normally, we dump all extensions, or none of them if include_everything
* it's necessary to skip built-in extensions, since we assume those will * is false (i.e., a --schema or --table switch was given). However, in
* already be installed in the target database. We identify such extensions * binary-upgrade mode it's necessary to skip built-in extensions, since we
* by their having OIDs in the range reserved for initdb. * 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 static void
selectDumpableExtension(ExtensionInfo *extinfo) selectDumpableExtension(ExtensionInfo *extinfo)
...@@ -1164,7 +1165,7 @@ selectDumpableExtension(ExtensionInfo *extinfo) ...@@ -1164,7 +1165,7 @@ selectDumpableExtension(ExtensionInfo *extinfo)
if (binary_upgrade && extinfo->dobj.catId.oid < (Oid) FirstNormalObjectId) if (binary_upgrade && extinfo->dobj.catId.oid < (Oid) FirstNormalObjectId)
extinfo->dobj.dump = false; extinfo->dobj.dump = false;
else else
extinfo->dobj.dump = true; extinfo->dobj.dump = include_everything;
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment