A roadmap of event triggers

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 object effected in a DROP CASCADE call.
  • INSTEAD OF: The idea here, is for an event trigger to take control of a command, analogous to the INSTEAD OF DML triggers.
  • CREATE TABLE on INSERT: The idea here, is to just create a new table whenever we receive an insert for the first time and the table doesn't exist.

Note

If you want to learn more about the features in progress and the patches, which are being discussed related to event trigger support in PostgreSQL, please follow the wiki page at https://wiki.postgresql.org/wiki/Event_Triggers.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.156.75