return RESTORE_PASS_POST_ACL;
/*
- * Comments need to be emitted in the same pass as their parent objects.
- * ACLs haven't got comments, and neither do matview data objects, but
- * event triggers do. (Fortunately, event triggers haven't got ACLs, or
- * we'd need yet another weird special case.)
+ * Comments and security labels need to be emitted in the same pass as
+ * their parent objects. ACLs haven't got comments and security labels,
+ * and neither do matview data objects, but event triggers do.
+ * (Fortunately, event triggers haven't got ACLs, or we'd need yet another
+ * weird special case.)
*/
- if (strcmp(te->desc, "COMMENT") == 0 &&
+ if ((strcmp(te->desc, "COMMENT") == 0 ||
+ strcmp(te->desc, "SECURITY LABEL") == 0) &&
strncmp(te->tag, "EVENT TRIGGER ", 14) == 0)
return RESTORE_PASS_POST_ACL;
appendPQExpBufferStr(query,
"SELECT label, provider, classoid, objoid, objsubid "
- "FROM pg_catalog.pg_seclabel "
+ "FROM pg_catalog.pg_seclabels "
"ORDER BY classoid, objoid, objsubid");
res = ExecuteSqlQuery(fout, query->data, PGRES_TUPLES_OK);
NULL, evtinfo->evtowner,
evtinfo->dobj.catId, 0, evtinfo->dobj.dumpId);
+ if (evtinfo->dobj.dump & DUMP_COMPONENT_SECLABEL)
+ dumpSecLabel(fout, "EVENT TRIGGER", qevtname,
+ NULL, evtinfo->evtowner,
+ evtinfo->dobj.catId, 0, evtinfo->dobj.dumpId);
+
destroyPQExpBuffer(query);
destroyPQExpBuffer(delqry);
free(qevtname);