Re: What about improving the rules system we have, was Re: Rules going away

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: What about improving the rules system we have, was Re: Rules going away
Дата
Msg-id CAHyXU0yTv8nMa2fJ5-SzHAi-GVCeZCbYuXWNNnLA6Cd0oL3VhQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: What about improving the rules system we have, was Re: Rules going away  (Harald Fuchs <hari.fuchs@gmail.com>)
Список pgsql-general
On Wed, Sep 28, 2011 at 11:46 AM, Harald Fuchs <hari.fuchs@gmail.com> wrote:
> In article <4116.1317226367@sss.pgh.pa.us>,
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>
>> Not sure this specific proposal makes any sense at all.  IMO the only
>> real advantage that rules have over triggers is that they work on a
>> set-operation basis not a tuple-by-tuple basis.
>
> Isn't that what statement-level triggers are for, at least in other DB
> systems?  How about telling PostgreSQL's statement-level triggers
> something about the set of rows they affect?

in theory that would be nice, but they just don't work that way.  you
don't even have access to the SQL statement firing the trigger IIRC.
that said, with some thought you could work an 'after' trigger into a
set level operation, say, by rigging something around now().

now that we have view triggers (not that rules ever really worked for
updating views anyways), even notwithstanding the minor limitations of
triggers of rules vs triggers, I personally find the RULE feature to
be useless and dangerous.  I'd vote for immediately deprecating it
without hesitation.

merlin

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

Предыдущее
От: Harald Fuchs
Дата:
Сообщение: Re: What about improving the rules system we have, was Re: Rules going away
Следующее
От: Venkat Balaji
Дата:
Сообщение: : Looking for a PostgreSQL book