Kyle <kyle(at)actarg(dot)com> writes:
> If someone happens to know the primary key of a record they should not be
> able to access, and they try to update it, I would like the backend to
> ignore the query (or better yet, raise an exception but I haven't figured
> out how to do that). If the status is correct, the update should proceed.
This might be better done with a trigger than a rule. For one thing,
a trigger can easily raise an exception. MHO is that rules are good
when you need to update multiple rows in other tables when certain
things happen. If you just want to validate or twiddle an individual
tuple as it's inserted/updated, a trigger is a good bet.
regards, tom lane