{
PQExpBuffer delq;
PQExpBuffer query;
+ PQExpBuffer labelq;
if (!(pubinfo->dobj.dump & DUMP_COMPONENT_DEFINITION))
return;
delq = createPQExpBuffer();
query = createPQExpBuffer();
+ labelq = createPQExpBuffer();
appendPQExpBuffer(delq, "DROP PUBLICATION %s;\n",
fmtId(pubinfo->dobj.name));
appendPQExpBuffer(query, "CREATE PUBLICATION %s",
fmtId(pubinfo->dobj.name));
+ appendPQExpBuffer(labelq, "PUBLICATION %s", fmtId(pubinfo->dobj.name));
+
if (pubinfo->puballtables)
appendPQExpBufferStr(query, " FOR ALL TABLES");
NULL, 0,
NULL, NULL);
+ if (pubinfo->dobj.dump & DUMP_COMPONENT_COMMENT)
+ dumpComment(fout, labelq->data,
+ NULL, pubinfo->rolname,
+ pubinfo->dobj.catId, 0, pubinfo->dobj.dumpId);
+
+ if (pubinfo->dobj.dump & DUMP_COMPONENT_SECLABEL)
+ dumpSecLabel(fout, labelq->data,
+ NULL, pubinfo->rolname,
+ pubinfo->dobj.catId, 0, pubinfo->dobj.dumpId);
+
destroyPQExpBuffer(delq);
destroyPQExpBuffer(query);
}
{
PQExpBuffer delq;
PQExpBuffer query;
+ PQExpBuffer labelq;
PQExpBuffer publications;
char **pubnames = NULL;
int npubnames = 0;
delq = createPQExpBuffer();
query = createPQExpBuffer();
+ labelq = createPQExpBuffer();
appendPQExpBuffer(delq, "DROP SUBSCRIPTION %s;\n",
fmtId(subinfo->dobj.name));
appendStringLiteralAH(query, subinfo->subslotname, fout);
appendPQExpBufferStr(query, ");\n");
+ appendPQExpBuffer(labelq, "SUBSCRIPTION %s", fmtId(subinfo->dobj.name));
+
ArchiveEntry(fout, subinfo->dobj.catId, subinfo->dobj.dumpId,
subinfo->dobj.name,
NULL,
NULL, 0,
NULL, NULL);
+ if (subinfo->dobj.dump & DUMP_COMPONENT_COMMENT)
+ dumpComment(fout, labelq->data,
+ NULL, subinfo->rolname,
+ subinfo->dobj.catId, 0, subinfo->dobj.dumpId);
+
+ if (subinfo->dobj.dump & DUMP_COMPONENT_SECLABEL)
+ dumpSecLabel(fout, labelq->data,
+ NULL, subinfo->rolname,
+ subinfo->dobj.catId, 0, subinfo->dobj.dumpId);
+
destroyPQExpBuffer(publications);
if (pubnames)
free(pubnames);
only_dump_test_schema => 1,
only_dump_test_table => 1,
role => 1,
+ section_post_data => 1,
test_schema_plus_blobs => 1, }, },
'COMMENT ON EXTENSION plpgsql' => {
only_dump_test_schema => 1,
only_dump_test_table => 1,
role => 1,
+ section_post_data => 1,
test_schema_plus_blobs => 1, }, },
'COMMENT ON TABLE dump_test.test_table' => {
data_only => 1,
exclude_dump_test_schema => 1,
exclude_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON COLUMN dump_test.test_table.col1' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
exclude_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON COLUMN dump_test.composite.f1' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON COLUMN dump_test.test_second_table.col1' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON COLUMN dump_test.test_second_table.col2' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON CONVERSION dump_test.test_conversion' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON COLLATION test0' => {
all_runs => 1,
only_dump_test_schema => 1,
only_dump_test_table => 1,
role => 1,
+ section_post_data => 1,
test_schema_plus_blobs => 1, }, },
'COMMENT ON LARGE OBJECT ...' => {
section_data => 1,
section_post_data => 1, }, },
+ 'COMMENT ON PUBLICATION pub1' => {
+ all_runs => 1,
+ create_order => 55,
+ create_sql => 'COMMENT ON PUBLICATION pub1
+ IS \'comment on publication\';',
+ regexp => qr/^COMMENT ON PUBLICATION pub1 IS 'comment on publication';/m,
+ like => {
+ binary_upgrade => 1,
+ clean => 1,
+ clean_if_exists => 1,
+ createdb => 1,
+ defaults => 1,
+ exclude_dump_test_schema => 1,
+ exclude_test_table => 1,
+ exclude_test_table_data => 1,
+ no_blobs => 1,
+ no_privs => 1,
+ no_owner => 1,
+ pg_dumpall_dbprivs => 1,
+ schema_only => 1,
+ section_post_data => 1,
+ with_oids => 1, },
+ unlike => {
+ column_inserts => 1,
+ data_only => 1,
+ only_dump_test_table => 1,
+ only_dump_test_schema => 1,
+ pg_dumpall_globals => 1,
+ pg_dumpall_globals_clean => 1,
+ role => 1,
+ section_data => 1,
+ section_pre_data => 1,
+ test_schema_plus_blobs => 1, }, },
+
+ 'COMMENT ON SUBSCRIPTION sub1' => {
+ all_runs => 1,
+ create_order => 55,
+ create_sql => 'COMMENT ON SUBSCRIPTION sub1
+ IS \'comment on subscription\';',
+ regexp => qr/^COMMENT ON SUBSCRIPTION sub1 IS 'comment on subscription';/m,
+ like => {
+ binary_upgrade => 1,
+ clean => 1,
+ clean_if_exists => 1,
+ createdb => 1,
+ defaults => 1,
+ exclude_dump_test_schema => 1,
+ exclude_test_table => 1,
+ exclude_test_table_data => 1,
+ no_blobs => 1,
+ no_privs => 1,
+ no_owner => 1,
+ pg_dumpall_dbprivs => 1,
+ schema_only => 1,
+ section_post_data => 1,
+ with_oids => 1, },
+ unlike => {
+ column_inserts => 1,
+ data_only => 1,
+ only_dump_test_table => 1,
+ only_dump_test_schema => 1,
+ pg_dumpall_globals => 1,
+ pg_dumpall_globals_clean => 1,
+ role => 1,
+ section_data => 1,
+ section_pre_data => 1,
+ test_schema_plus_blobs => 1, }, },
+
'COMMENT ON TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1' => {
all_runs => 1,
catch_all => 'COMMENT commands',
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON TEXT SEARCH PARSER dump_test.alt_ts_prs1' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON TEXT SEARCH TEMPLATE dump_test.alt_ts_temp1' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON TYPE dump_test.planets - ENUM' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON TYPE dump_test.textrange - RANGE' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON TYPE dump_test.int42 - Regular' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
'COMMENT ON TYPE dump_test.undefined - Undefined' => {
all_runs => 1,
data_only => 1,
exclude_dump_test_schema => 1,
only_dump_test_table => 1,
- role => 1, }, },
+ role => 1,
+ section_post_data => 1, }, },
# catch-all for COMMENTs
'COMMENT commands' => {
unlike => {
pg_dumpall_globals => 1,
pg_dumpall_globals_clean => 1,
- section_data => 1,
- section_post_data => 1, }, },
+ section_data => 1, }, },
'COPY test_table' => {
all_runs => 1,