On Thu, Jan 24, 2002 at 05:21:14PM +0100, Jean-Michel POURE wrote:
> Le Mercredi 23 Janvier 2002 15:09, Kaare Rasmussen a ?crit :
> > Isn't it the same as
> > DROP VIEW name
> > CREATE VIEW name
> > DROP TRIGGER name
> > CREATE TRIGGER name
>
> No, CREATE OR REPLACE keeps oids, which is much more interesting.
>
> A few examples :
>
> 1) Views with triggers.
> Triggers can be used to update views. But in the case of a simple
> DROP/CREATE, after dropping the view, the triggers are lost (depency problem).
>
> IFirthermore, if we had CREATE OR REPLACE, we could have pgAdmin II create
> the underlying triggers automatically to update views...
Just a nomenclature/language thing: a trigger on a view won't do very
much, and I think can not be created in 7.2. A trigger fires when
tuples are about to be stored or accessed from storage: since a view
_has_ no storage of it's own (well, none that's used) a trigger will
never fire. Rules, on the other hand, rewrite the SQL: that's how views
are implemented. So, you mean ' VIEWs with additional rules'.
Ross