strcmp(type, "DATABASE") == 0 ||
strcmp(type, "PROCEDURAL LANGUAGE") == 0 ||
strcmp(type, "SCHEMA") == 0 ||
+ strcmp(type, "EVENT TRIGGER") == 0 ||
strcmp(type, "FOREIGN DATA WRAPPER") == 0 ||
strcmp(type, "SERVER") == 0 ||
strcmp(type, "PUBLICATION") == 0 ||
return;
}
- write_msg(modulename, "WARNING: don't know how to set owner for object type %s\n",
+ write_msg(modulename, "WARNING: don't know how to set owner for object type \"%s\"\n",
type);
}
strcmp(te->desc, "OPERATOR FAMILY") == 0 ||
strcmp(te->desc, "PROCEDURAL LANGUAGE") == 0 ||
strcmp(te->desc, "SCHEMA") == 0 ||
+ strcmp(te->desc, "EVENT TRIGGER") == 0 ||
strcmp(te->desc, "TABLE") == 0 ||
strcmp(te->desc, "TYPE") == 0 ||
strcmp(te->desc, "VIEW") == 0 ||
}
else
{
- write_msg(modulename, "WARNING: don't know how to set owner for object type %s\n",
+ write_msg(modulename, "WARNING: don't know how to set owner for object type \"%s\"\n",
te->desc);
}
}
{
DumpOptions *dopt = fout->dopt;
PQExpBuffer query;
+ PQExpBuffer delqry;
PQExpBuffer labelq;
/* Skip if not to be dumped */
return;
query = createPQExpBuffer();
+ delqry = createPQExpBuffer();
labelq = createPQExpBuffer();
appendPQExpBufferStr(query, "CREATE EVENT TRIGGER ");
}
appendPQExpBufferStr(query, ";\n");
}
+
+ appendPQExpBuffer(delqry, "DROP EVENT TRIGGER %s;\n",
+ fmtId(evtinfo->dobj.name));
+
appendPQExpBuffer(labelq, "EVENT TRIGGER %s",
fmtId(evtinfo->dobj.name));
if (evtinfo->dobj.dump & DUMP_COMPONENT_DEFINITION)
ArchiveEntry(fout, evtinfo->dobj.catId, evtinfo->dobj.dumpId,
- evtinfo->dobj.name, NULL, NULL, evtinfo->evtowner, false,
+ evtinfo->dobj.name, NULL, NULL,
+ evtinfo->evtowner, false,
"EVENT TRIGGER", SECTION_POST_DATA,
- query->data, "", NULL, NULL, 0, NULL, NULL);
+ query->data, delqry->data, NULL,
+ NULL, 0,
+ NULL, NULL);
if (evtinfo->dobj.dump & DUMP_COMPONENT_COMMENT)
dumpComment(fout, labelq->data,
evtinfo->dobj.catId, 0, evtinfo->dobj.dumpId);
destroyPQExpBuffer(query);
+ destroyPQExpBuffer(delqry);
destroyPQExpBuffer(labelq);
}
'ALTER COLLATION test0 OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER COLLATION test0 OWNER TO .*;/m,
collation => 1,
like => {
'ALTER FOREIGN DATA WRAPPER dummy OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER FOREIGN DATA WRAPPER dummy OWNER TO .*;/m,
like => {
binary_upgrade => 1,
'ALTER SERVER s1 OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER SERVER s1 OWNER TO .*;/m,
like => {
binary_upgrade => 1,
'ALTER FUNCTION dump_test.pltestlang_call_handler() OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^
\QALTER FUNCTION dump_test.pltestlang_call_handler() \E
\QOWNER TO \E
'ALTER OPERATOR FAMILY dump_test.op_family OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^
\QALTER OPERATOR FAMILY dump_test.op_family USING btree \E
\QOWNER TO \E
'ALTER OPERATOR CLASS dump_test.op_class OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^
\QALTER OPERATOR CLASS dump_test.op_class USING btree \E
\QOWNER TO \E
'ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO .*;/m,
like => {
binary_upgrade => 1,
'ALTER SCHEMA dump_test OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER SCHEMA dump_test OWNER TO .*;/m,
like => {
binary_upgrade => 1,
'ALTER SCHEMA dump_test_second_schema OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER SCHEMA dump_test_second_schema OWNER TO .*;/m,
like => {
binary_upgrade => 1,
'ALTER TABLE test_table OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER TABLE test_table OWNER TO .*;/m,
like => {
binary_upgrade => 1,
'ALTER TABLE test_second_table OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER TABLE test_second_table OWNER TO .*;/m,
like => {
binary_upgrade => 1,
'ALTER TABLE test_third_table OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER TABLE test_third_table OWNER TO .*;/m,
like => {
binary_upgrade => 1,
'ALTER TABLE measurement OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER TABLE measurement OWNER TO .*;/m,
like => {
binary_upgrade => 1,
'ALTER TABLE measurement_y2006m2 OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER TABLE measurement_y2006m2 OWNER TO .*;/m,
like => {
binary_upgrade => 1,
'ALTER FOREIGN TABLE foreign_table OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp => qr/^ALTER FOREIGN TABLE foreign_table OWNER TO .*;/m,
like => {
binary_upgrade => 1,
'ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp =>
qr/^ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 OWNER TO .*;/m,
like => {
'ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 OWNER TO' => {
all_runs => 1,
catch_all =>
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)',
+ 'ALTER ... OWNER commands (except post-data objects)',
regexp =>
qr/^ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 OWNER TO .*;/m,
like => {
only_dump_test_table => 1,
role => 1, }, },
- # catch-all for ALTER ... OWNER (except LARGE OBJECTs and PUBLICATIONs)
- 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)' => {
+ # catch-all for ALTER ... OWNER (except post-data objects)
+ 'ALTER ... OWNER commands (except post-data objects)' => {
all_runs => 0, # catch-all
regexp =>
-qr/^ALTER (?!LARGE OBJECT|PUBLICATION|SUBSCRIPTION)(.*) OWNER TO .*;/m,
+qr/^ALTER (?!EVENT TRIGGER|LARGE OBJECT|PUBLICATION|SUBSCRIPTION)(.*) OWNER TO .*;/m,
like => {}, # use more-specific options above
unlike => {
column_inserts => 1,