Creating event triggers
Event triggers are created using the CREATE EVENT TRIGGER
command. Before you can create an event trigger, you need a function that the trigger will execute. This function must return a special type called EVENT_TRIGGER
. If you happen to define multiple event triggers, they are executed in the alphabetical order of their names.
Currently, event triggers are supported on three events, as follows:
ddl_command_start
: This event occurs just before aCREATE
,ALTER
, orDROP DDL
command is executedddl_command_end
: This event occurs just after aCREATE
,ALTER
, orDROP
command has finished executingsql_drop
: This event occurs just before theddl_command_end
event for the commands that drop database objects
You can specify a WHEN
clause ...
Get PostgreSQL Server Programming - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.