开发者

How to pick a default value to the column in the trigger?

开发者 https://www.devze.com 2023-01-15 18:32 出处:网络
We implement some triggers which perform some operations with insert dat开发者_如何学Goa before committing them to the database and when some conditions fail the trigger should pick up the default val

We implement some triggers which perform some operations with insert dat开发者_如何学Goa 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.


NEW.colname = DEFAULT will do the trick.

0

精彩评论

暂无评论...
验证码 换一张
取 消