0

PostgreSQL supports "Event Triggers" which is defined as,

To supplement the trigger mechanism discussed in Chapter 39, PostgreSQL also provides event triggers. Unlike regular triggers, which are attached to a single table and capture only DML events, event triggers are global to a particular database and are capable of capturing DDL events.

SQL Server "DDL Triggers",

DDL triggers fire in response to a variety of Data Definition Language (DDL) events. These events primarily correspond to Transact-SQL statements that start with the keywords CREATE, ALTER, DROP, GRANT, DENY, REVOKE or UPDATE STATISTICS. Certain system stored procedures that perform DDL-like operations can also fire DDL triggers.

Oracle simply calls them "Triggers". Is there any standardized functionality that provides this functionality?

3

The SQL Spec currently only says this about Triggers,

4.6.5.5 Triggers

A trigger is an object associated with a single base table or a single viewed table. A trigger specifies a subject table, trigger event, a trigger action time, and one or more triggered actions.

  • A trigger event specifies what action on the subject table shall cause the triggered actions. A trigger event is either INSERT, DELETE, or UPDATE.
  • A trigger action time specifies whether the triggered action is to taken BEFORE, INSTEAD OF, or AFTER the trigger event.
  • A triggered action is either an <SQL procedure statement> or BEGIN ATOMIC, followed by one or more <SQL procedure statement>s terminated with <semicolon>s, followed by END.

Without any further mention, I believe the spec does not currently address this functionality at all.


Formatting slightly modified from the spec. I turned it into a list. Spec used "Information technology — Database languages — SQL — Part 1: Framework (SQL/Framework)"

  • How about a link to the SQL Spec. – Volte Jan 25 at 22:21
  • @Volte you can find the 2011n draft here wiscorp.com/SQLStandards.html SQL is a paid spec. You can just give it away or distribute it. – Evan Carroll Jan 25 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.