DUMP_COMPONENT_NONE;
}
+/*
+ * selectDumpablePublicationTable: policy-setting subroutine
+ * Mark a publication table as to be dumped or not
+ *
+ * Publication tables have schemas, but those are ignored in decision making,
+ * because publications are only dumped when we are dumping everything.
+ */
+static void
+selectDumpablePublicationTable(DumpableObject *dobj, Archive *fout)
+{
+ if (checkExtensionMembership(dobj, fout))
+ return; /* extension membership overrides all else */
+
+ dobj->dump = fout->dopt->include_everything ?
+ DUMP_COMPONENT_ALL : DUMP_COMPONENT_NONE;
+}
+
/*
* selectDumpableObject: policy-setting subroutine
* Mark a generic dumpable object as to be dumped or not
if (strlen(pubinfo[i].rolname) == 0)
write_msg(NULL, "WARNING: owner of publication \"%s\" appears to be invalid\n",
pubinfo[i].dobj.name);
+
+ /* Decide whether we want to dump it */
+ selectDumpableObject(&(pubinfo[i].dobj), fout);
}
PQclear(res);
static void
dumpPublication(Archive *fout, PublicationInfo *pubinfo)
{
- DumpOptions *dopt = fout->dopt;
PQExpBuffer delq;
PQExpBuffer query;
- if (dopt->dataOnly)
+ if (!(pubinfo->dobj.dump & DUMP_COMPONENT_DEFINITION))
return;
delq = createPQExpBuffer();
pubrinfo[j].dobj.name = tbinfo->dobj.name;
pubrinfo[j].pubname = pg_strdup(PQgetvalue(res, j, i_pubname));
pubrinfo[j].pubtable = tbinfo;
+
+ /* Decide whether we want to dump it */
+ selectDumpablePublicationTable(&(pubrinfo[j].dobj), fout);
}
PQclear(res);
}
static void
dumpPublicationTable(Archive *fout, PublicationRelInfo *pubrinfo)
{
- DumpOptions *dopt = fout->dopt;
TableInfo *tbinfo = pubrinfo->pubtable;
PQExpBuffer query;
char *tag;
- if (dopt->dataOnly)
+ if (!(pubrinfo->dobj.dump & DUMP_COMPONENT_DEFINITION))
return;
tag = psprintf("%s %s", pubrinfo->pubname, tbinfo->dobj.name);
exclude_test_table_data => 1,
no_privs => 1,
no_blobs => 1,
- only_dump_test_schema => 1, # XXX Should be unlike
- only_dump_test_table => 1, # XXX Should be unlike
pg_dumpall_dbprivs => 1,
- role => 1, # XXX Should be unlike
schema_only => 1,
section_post_data => 1,
- test_schema_plus_blobs => 1, # XXX Should be unlike
with_oids => 1, },
unlike => {
column_inserts => 1,
data_only => 1,
no_owner => 1,
+ only_dump_test_schema => 1,
+ only_dump_test_table => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1,
+ role => 1,
section_pre_data => 1,
- section_data => 1, }, },
+ section_data => 1,
+ test_schema_plus_blobs => 1, }, },
'ALTER LARGE OBJECT ... OWNER TO' => {
all_runs => 1,
no_blobs => 1,
no_privs => 1,
no_owner => 1,
- only_dump_test_schema => 1, # XXX Should be unlike
- only_dump_test_table => 1, # XXX Should be unlike
pg_dumpall_dbprivs => 1,
- role => 1, # XXX Should be unlike
schema_only => 1,
section_post_data => 1,
- test_schema_plus_blobs => 1, # XXX Should be unlike
with_oids => 1, },
unlike => {
- section_pre_data => 1,
+ only_dump_test_schema => 1,
+ only_dump_test_table => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1,
- section_pre_data => 1, }, },
+ role => 1,
+ section_pre_data => 1,
+ test_schema_plus_blobs => 1, }, },
'CREATE PUBLICATION pub2' => {
all_runs => 1,
no_blobs => 1,
no_privs => 1,
no_owner => 1,
- only_dump_test_schema => 1, # XXX Should be unlike
- only_dump_test_table => 1, # XXX Should be unlike
pg_dumpall_dbprivs => 1,
- role => 1, # XXX Should be unlike
schema_only => 1,
section_post_data => 1,
- test_schema_plus_blobs => 1, # XXX Should be unlike
with_oids => 1, },
unlike => {
- section_pre_data => 1,
+ only_dump_test_schema => 1,
+ only_dump_test_table => 1,
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1,
- section_pre_data => 1, }, },
+ role => 1,
+ section_pre_data => 1,
+ test_schema_plus_blobs => 1, }, },
'CREATE SUBSCRIPTION sub1' => {
all_runs => 1,
no_blobs => 1,
no_privs => 1,
no_owner => 1,
- only_dump_test_schema => 1,
- only_dump_test_table => 1,
pg_dumpall_dbprivs => 1,
schema_only => 1,
section_post_data => 1,
- test_schema_plus_blobs => 1,
with_oids => 1, },
unlike => {
column_inserts => 1,
section_pre_data => 1,
exclude_dump_test_schema => 1,
exclude_test_table => 1,
+ only_dump_test_schema => 1,
+ only_dump_test_table => 1,
pg_dumpall_globals => 1,
- pg_dumpall_globals_clean => 1, }, },
+ pg_dumpall_globals_clean => 1,
+ test_schema_plus_blobs => 1, }, },
'ALTER PUBLICATION pub1 ADD TABLE test_second_table' => {
create_order => 52,
create_sql =>
exclude_test_table_data => 1,
no_privs => 1,
no_owner => 1,
- only_dump_test_schema => 1,
pg_dumpall_dbprivs => 1,
schema_only => 1,
- section_post_data => 1,
- test_schema_plus_blobs => 1, },
+ section_post_data => 1, },
unlike => {
section_pre_data => 1,
exclude_dump_test_schema => 1,
+ only_dump_test_schema => 1,
only_dump_test_table => 1,
pg_dumpall_globals => 1,
- pg_dumpall_globals_clean => 1, }, },
+ pg_dumpall_globals_clean => 1,
+ test_schema_plus_blobs => 1, }, },
'CREATE SCHEMA dump_test' => {
all_runs => 1,