flâneur — a map of the web's best reading

PostgreSQL: Documentation: 16: 39.1. Overview of Trigger Behavior

postgresql.org · 2,617 words · saved by 1 readers

A trigger is a specification that the database should automatically execute a particular function whenever a certain type of operation is performed. Triggers can be attached to tables (partitioned or not), views, and foreign tables. On tables and foreign tables, triggers can be defined to execute either before or after any INSERT, UPDATE, or DELETE operation, either once per modified row, or once per SQL statement. UPDATE triggers can moreover be set to fire only if certain columns are mentioned in the SET clause of the UPDATE statement. Triggers can also fire for TRUNCATE statements. If a trigger event occurs, the trigger's function is called at the appropriate time to handle the event. On views, triggers can be defined to execute instead of INSERT, UPDATE, or DELETE operations. Such INSTEAD OF triggers are fired once for each row that needs to be modified in the view. It is the responsibility of the trigger's function to perform the necessary modifications to the view's underlying ba

PostgreSQL: Documentation: 18: 37.1. Overview of Trigger Behavior July 16, 2026: PostgreSQL 19 Beta 2 Released! Documentation → PostgreSQL 18 Supported Versions: Current ( 18 ) / 17 / 16 / 15 / 14 Development Versions: 19 / devel Unsupported versions: 13 / 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 37.1. Overview of Trigger Behavior Prev Up Chapter 37. Triggers Home Next 37.1. Overview of Trigger Behavior # A trigger is a specification that the database should automatically execute a particular function whenever a certain type of operation is performed. Trigg

Explore this link on the map →

related reading