shell from expanding the wildcards.
</para>
+ <para>
+ Any configuration relation registered by
+ <function>pg_extension_config_dump</function> is included in the
+ dump if its extension is specified by <option>--extension</option>.
+ </para>
+
<note>
<para>
When <option>-e</option> is specified,
* Note that we create TableDataInfo objects even in schemaOnly mode, ie,
* user data in a configuration table is treated like schema data. This
* seems appropriate since system data in a config table would get
- * reloaded by CREATE EXTENSION.
+ * reloaded by CREATE EXTENSION. If the extension is not listed in the
+ * list of extensions to be included, none of its data is dumped.
*/
for (i = 0; i < numExtensions; i++)
{
int nconfigitems = 0;
int nconditionitems = 0;
+ /*
+ * Check if this extension is listed as to include in the dump. If
+ * not, any table data associated with it is discarded.
+ */
+ if (extension_include_oids.head != NULL &&
+ !simple_oid_list_member(&extension_include_oids,
+ curext->dobj.catId.oid))
+ continue;
+
if (strlen(extconfig) != 0 || strlen(extcondition) != 0)
{
int j;
'pg_dump', '--no-sync', "--file=$tempdir/without_extension.sql",
'--extension=plpgsql', 'postgres',
],
+ },
+
+ # plgsql in the list of extensions blocks the dump of extension
+ # test_pg_dump. "public" is the schema used by the extension
+ # test_pg_dump, but none of its objects should be dumped.
+ without_extension_explicit_schema => {
+ dump_cmd => [
+ 'pg_dump',
+ '--no-sync',
+ "--file=$tempdir/without_extension_explicit_schema.sql",
+ '--extension=plpgsql',
+ '--schema=public',
+ 'postgres',
+ ],
+ },
+
+ # plgsql in the list of extensions blocks the dump of extension
+ # test_pg_dump, but not the dump of objects not dependent on the
+ # extension located on a schema maintained by the extension.
+ without_extension_internal_schema => {
+ dump_cmd => [
+ 'pg_dump',
+ '--no-sync',
+ "--file=$tempdir/without_extension_internal_schema.sql",
+ '--extension=plpgsql',
+ '--schema=regress_pg_dump_schema',
+ 'postgres',
+ ],
},);
###############################################################
pg_dumpall_globals => 1,
section_data => 1,
section_pre_data => 1,
+ # Excludes this schema as extension is not listed.
+ without_extension_explicit_schema => 1,
},
},
pg_dumpall_globals => 1,
section_data => 1,
section_pre_data => 1,
+ # Excludes this schema as extension is not listed.
+ without_extension_explicit_schema => 1,
},
},
%full_runs,
schema_only => 1,
section_pre_data => 1,
+ # Excludes the extension and keeps the schema's data.
+ without_extension_internal_schema => 1,
},
},);