In PostgreSQL and several other relational databases, the reserved word OF appears inside a CREATE TRIGGER statement. When you define a trigger on the UPDATE event, attaching the clause UPDATE OF column1, column2 … limits the trigger’s execution to rows where at least one of the listed columns actually changes. This selective firing avoids unnecessary trigger overhead when irrelevant columns are updated and gives developers fine-grained control over data-change reactions.OF cannot be used with INSERT, DELETE, or TRUNCATE events. It is legal only after the UPDATE keyword inside the event list. If more than one column is provided, PostgreSQL treats the list as an OR condition: the trigger executes when any listed column value differs between OLD and NEW.The feature is part of the SQL standard for column-specific triggers and is fully supported in PostgreSQL, Oracle, and Firebird. SQL Server and MySQL do not implement it natively, so developers on those platforms must add column checks inside the trigger body instead.
column1, column2 ...
(identifiers) - One or more column names that, when updated, will cause the trigger to fire. None if omitted (the trigger fires on any column change).CREATE TRIGGER, BEFORE, AFTER, UPDATE, INSTEAD OF, OLD and NEW records
PostgreSQL 7.3
PostgreSQL, Oracle, Firebird, and IBM Db2 support OF in UPDATE triggers. MySQL and SQL Server do not.
Yes, but it harms readability and maintainability. Favor a smaller, targeted list.
Create a normal UPDATE trigger and add IF UPDATE(column_name) checks inside the trigger body.
Yes, positively. By skipping unnecessary trigger executions you conserve CPU and I/O, especially on high-write tables.