Re: Rule not invoked in 7.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kyle <kyle(at)actarg(dot)com>
Cc: Jan Wieck <janwieck(at)yahoo(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Rule not invoked in 7.1
Date: 2001-01-26 03:35:46
Message-ID: 28329.980480146@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-01-26 03:47:23 Re: Cannot CREATE INDEX that contains a function
Previous Message Ron Peterson 2001-01-26 02:34:40 Re: Is there anything like DESCRIBE?