Question

We implement some triggers which perform some operations with insert data before committing them to the database and when some conditions fail the trigger should pick up the default value for corresponding column.

How to perform it inside the trigger?

Thank you. PS. we work with PostgreSQL, but implementations with other DBMS may give a hint.

Was it helpful?

Solution

NEW.colname = DEFAULT will do the trick.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top