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