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

From Jean-Michel POURE
Subject Re: Add OR REPLACE clauses to non-FUNCTION object creation in PostgreSQL 7.3
Date
Msg-id 200201241621.g0OGLEL26782@www1.translationforge
Whole thread Raw
In response to Re: Add OR REPLACE clauses to non-FUNCTION object creation in PostgreSQL 7.3  ("Kaare Rasmussen" <kar@kakidata.dk>)
Responses Re: Add OR REPLACE clauses to non-FUNCTION object creation in PostgreSQL 7.3
List pgsql-hackers
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...

2) Server side code consistency
IMHO, it is not possible to DROP / CREATE a view in a single transaction. 
Therefore, if you drop a view and the definition of the new view is 
incorrect, you loose the view. You can always save the old view definition, 
but this is not serious programming...

3) Future database IDE will be built upon abstraction layers (PEAR DB, 
MetatData, GnomeDB) to enable easy migration from one database to another 
(and make PostgreSQL world champion which is our goal).  Abstraction layers 
will not take into account things like DROP/CREATE.

In more general aspects :

At pgAdmin II, we would like to bundle pgAdmin with a Windows PostgreSQL 
installer wizard. And upload the package to free downloading sites. We need 
these features to say : "Look, PostgreSQL is the new AccessXP competitor" or 
whatever. This will bring a new audience to PostgreSQL.

Best regards,
Jean-Michel POURE


pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Add OR REPLACE clauses to non-FUNCTION object creat
Next
From: Don Baccus
Date:
Subject: Re: PostgreSQL crashes with Qmail-SQL