Data definition language triggers (DDL triggers), also known as event triggers, are special triggers that, instead of being associated with a table, are associated with a whole database. An event trigger fires when a particular event happens within the database. Instead of being attached to regular SQL statements, an event trigger is attached to commands, which are statements that manage database objects (hence the name DDL triggers).
For DML triggers, an event trigger is defined by the event and the timing and executes a stored procedure (a FUNCTION). Events that fire DDL triggers are DDL statements, such as CREATE, ALTER, DROP, GRANT, REVOKE, and some other utility commands such as SECURITY LABEL and COMMENT.
The event is specified by the execution of one of the preceding commands, grouped in any of the following categories:
- ddl_command_start happens...