Re: Rule not invoked in 7.1

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Rule not invoked in 7.1
Дата
Msg-id 28329.980480146@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Rule not invoked in 7.1  (Kyle <kyle@actarg.com>)
Ответы Re: Rule not invoked in 7.1
Список pgsql-sql
Kyle <kyle@actarg.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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Ron Peterson
Дата:
Сообщение: Re: Is there anything like DESCRIBE?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Cannot CREATE INDEX that contains a function