Is it possible to have postresql restrict/prevent an update on a specific record if the update includes changes to specific columns?
How would this be implemented. A
The easiest way is to create BEFORE UPDATE
trigger that will compare OLD
and NEW
row and RAISE EXCEPTION
if the change to the row is forbidden.
No, but it should be pretty trivial to write.
Just set up a BEFORE UPDATE
trigger that compares old field against new field and does a RAISE ERROR
if they're different.
The pgSQL docs have a few examples of how to write a trigger function.