{
HeapTuple tup;
Form_pg_event_trigger trigForm;
-
- /* no objname support here */
- if (objname)
- *objname = NIL;
+ char *evtname;
tup = SearchSysCache1(EVENTTRIGGEROID,
ObjectIdGetDatum(object->objectId));
elog(ERROR, "cache lookup failed for event trigger %u",
object->objectId);
trigForm = (Form_pg_event_trigger) GETSTRUCT(tup);
- appendStringInfoString(&buffer,
- quote_identifier(NameStr(trigForm->evtname)));
+ evtname = NameStr(trigForm->evtname);
+ appendStringInfoString(&buffer, quote_identifier(evtname));
+ if (objname)
+ *objname = list_make1(evtname);
ReleaseSysCache(tup);
break;
}
NOTICE: DROP POLICY - ddl_command_start
NOTICE: DROP POLICY - sql_drop
NOTICE: DROP POLICY - ddl_command_end
+-- Check the object addresses of all the event triggers.
+SELECT
+ evtname,
+ pg_describe_object('pg_event_trigger'::regclass, oid, 0),
+ pg_identify_object('pg_event_trigger'::regclass, oid, 0),
+ pg_identify_object_as_address('pg_event_trigger'::regclass, oid, 0)
+ FROM pg_event_trigger
+ ORDER BY evtname;
+ evtname | pg_describe_object | pg_identify_object | pg_identify_object_as_address
+-------------------+---------------------------------+--------------------------------------------------------+------------------------------------------
+ end_rls_command | event trigger end_rls_command | ("event trigger",,end_rls_command,end_rls_command) | ("event trigger",{end_rls_command},{})
+ sql_drop_command | event trigger sql_drop_command | ("event trigger",,sql_drop_command,sql_drop_command) | ("event trigger",{sql_drop_command},{})
+ start_rls_command | event trigger start_rls_command | ("event trigger",,start_rls_command,start_rls_command) | ("event trigger",{start_rls_command},{})
+(3 rows)
+
DROP EVENT TRIGGER start_rls_command;
DROP EVENT TRIGGER end_rls_command;
DROP EVENT TRIGGER sql_drop_command;
ALTER POLICY p1 ON event_trigger_test RENAME TO p2;
DROP POLICY p2 ON event_trigger_test;
+-- Check the object addresses of all the event triggers.
+SELECT
+ evtname,
+ pg_describe_object('pg_event_trigger'::regclass, oid, 0),
+ pg_identify_object('pg_event_trigger'::regclass, oid, 0),
+ pg_identify_object_as_address('pg_event_trigger'::regclass, oid, 0)
+ FROM pg_event_trigger
+ ORDER BY evtname;
+
DROP EVENT TRIGGER start_rls_command;
DROP EVENT TRIGGER end_rls_command;
DROP EVENT TRIGGER sql_drop_command;