I have a nullable column that should be only assignable once. Once set, any attempt to overwrite the value should fail. Can this be accomplished with a CHECK constraint (i.e. is it possible to look at pre-update value of the column and compare with the new value) or can this only be accomplished with an UPDATE TRIGGER?
Thank you!
You can do this with an
updatetrigger, with a query like this:A check constraint has no temporal recognition, that I’m aware of.