RefLib

Reference library for AI

Back

postgresql_16:6.6.10 Trigger Functions

PostgreSQL 16 > Server Programming > PL/pgSQL — SQL Procedural Language > Trigger Functions

PL/pgSQL can be used to define trigger functions on data changes or database events. A trigger function is created with the CREATE FUNCTION command, declaring it as a function with no arguments and a return type of trigger (for data change triggers) or event_trigger (for database event triggers). Special local variables named TG_*something* are automatically defined to describe the condition that triggered the call.

Subsections

Back