Re: [GENERAL] rule's and trigger's - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: [GENERAL] rule's and trigger's
Date
Msg-id Pine.LNX.4.20.9911261447210.344-100000@localhost.localdomain
Whole thread Raw
In response to rule's and trigger's  ("J. Roeleveld" <j.roeleveld@softhome.net>)
List pgsql-general
On 1999-11-25, J. Roeleveld mentioned:

> I was wondering if anyone knows what's being executed first,
> a Rule on a view, or a trigger set to 'before <something>' on a view?
>
> Eg. what's executed first? The RULE, or the TRIGGER?

The rules are done first. The reason is that the rules actually modify the
query before it gets to execution. In case of a view, a trigger would then
act on the query to the base table. Thus a trigger on a view might not
make too much sense.

See also the relevant chapters (39 & 41) in the Programmer's Guide.

--
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



pgsql-general by date:

Previous
From: Matthew Leo
Date:
Subject: Re: PostgreSQL
Next
From: Peter Eisentraut
Date:
Subject: Re: [GENERAL] about speed