Tutorial by Examples

This is a simple trigger function. CREATE OR REPLACE FUNCTION my_simple_trigger_function() RETURNS trigger AS $BODY$ BEGIN -- TG_TABLE_NAME :name of the table that caused the trigger invocation IF (TG_TABLE_NAME = 'users') THEN --TG_OP : operation the trigger was fired IF (TG_O...
Trigger can be specified to fire: BEFORE the operation is attempted on a row - insert, update or delete; AFTER the operation has completed - insert, update or delete; INSTEAD OF the operation in the case of inserts, updates or deletes on a view. Trigger that is marked: FOR EACH ROW is cal...

Page 1 of 1