CREATE LANGUAGE plperlu; \set ECHO none CREATE TEMP TABLE test(a INTEGER, b INTEGER, c INTEGER); INSERT INTO test VALUES(1, 2, 3); CREATE TRIGGER check_updates_on_test BEFORE INSERT OR UPDATE ON test FOR EACH ROW EXECUTE PROCEDURE check_updates('ASSERT_MESSAGE', 'Foo', 'bar happpend', 'a', 'b', '%s + %s > 20', 'NEW.a', 'NEW.b'); -- allow -- UPDATE test SET c = 10; -- deny -- UPDATE test SET a = 5, b = 4 WHERE a = 1; ERROR: error from Perl trigger function: ASSERTION Foo: bar happpend. DETAIL: update of attribute "a" denied by the trigger "check_updates_on_test" when expression 5 + 4 > 20 is false at line 102. -- allow -- UPDATE test SET a = 11, b = 10 WHERE a = 1; DROP LANGUAGE plperlu CASCADE; NOTICE: drop cascades to function check_updates() NOTICE: drop cascades to trigger check_updates_on_test on table test