As you can see, the current implementation of event triggers in PL/pgsql and PostgreSQL 9.4 is rather limited. However, there are more changes and features planned for the upcoming releases that will expand the scope, in which event triggers will become more useful. Here are the highlights of what we can look forward to in the future:
Access to more information: More
TG_*
variables are going to be available, in order to provide more information about the command that is running and on which object it is running. We can look forward to the following variables in future PostgreSQL versions:TG_OBJECTID
TG_OBJECTNAME
TG_SCHEMANAME
TG_OPERATION
TG_OBTYPENAME
TG_CONTEXT
Accessors: These are just functions which give you some information. In this case the
pg_get_event_command_string
function will give the full command string of the DDL command that caused the event trigger to fire.pg_get_event_command_string()
Support of DROP CASCADE: Here, event triggers will be fired for each...