Re: Add OR REPLACE clauses to non-FUNCTION object creation in PostgreSQL 7.3

From: "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu>
To: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>
Cc: Kaare Rasmussen <kar(at)kakidata(dot)dk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add OR REPLACE clauses to non-FUNCTION object creation in PostgreSQL 7.3
Date: 2002-01-24 16:58:14
Message-ID: 20020124165813.GC15695@rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Devogelaere 2002-01-24 16:59:43 Re: PostgreSQL crashes with Qmail-SQL
Previous Message Tom Lane 2002-01-24 16:54:56 Re: Checking for undefined in Perl interface code?