Sample Header Ad - 728x90

postgresql - Policy to prevent a field from being updated

3 votes
1 answer
4249 views
How can I create a policy to prevent a field from being updated? I am thinking something like this:
CREATE POLICY "test" ON posts.created_at FOR UPDATE WITH CHECK (exists(created_at));
Obviously this does not work, but I would like a way for this to work as long as there is no created_at coming into the UPDATE fields. J
Asked by Jonathan (153 rep)
Feb 7, 2022, 05:41 AM
Last activity: May 1, 2024, 12:58 AM