Attribute triggers

Tried to translate attribute triggers (PostgreSQL compatibility issues).