1

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?

Michael Kutz
  • 4,919
  • 1
  • 10
  • 14
Evan Carroll
  • 65,432
  • 50
  • 254
  • 507

1 Answers1

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)"

Evan Carroll
  • 65,432
  • 50
  • 254
  • 507