Re: Add OR REPLACE clauses to non-FUNCTION object creation in PostgreSQL 7.3 - Mailing list pgsql-hackers

From Ross J. Reedstrom
Subject Re: Add OR REPLACE clauses to non-FUNCTION object creation in PostgreSQL 7.3
Date
Msg-id 20020124165813.GC15695@rice.edu
Whole thread Raw
In response to Re: Add OR REPLACE clauses to non-FUNCTION object creation in PostgreSQL 7.3  (Jean-Michel POURE <jm.poure@freesurf.fr>)
Responses Re: Add OR REPLACE clauses to non-FUNCTION object creation in PostgreSQL 7.3  (Jean-Michel POURE <jm.poure@freesurf.fr>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Michael Devogelaere
Date:
Subject: Re: PostgreSQL crashes with Qmail-SQL
Next
From: "Mitch Vincent"
Date:
Subject: Re: PostgreSQL crashes with Qmail-SQL