Re: CREATE OR REPLACE TRIGGER

From: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-patches(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE OR REPLACE TRIGGER
Date: 2002-08-13 10:10:12
Message-ID: 200208131210.12202.jm.poure@freesurf.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Le Dimanche 11 Août 2002 17:53, Tom Lane a écrit :
> Hmm. I remember Poure asking repeatedly for CREATE OR REPLACE VIEW,
> and that makes a lot of sense to me, because other things *can* depend
> on a view. (Unfortunately, by the same token it's a lot harder to do.)
> The use-case for replacing a trigger is not visible to the naked eye.

Dear Tom,

Replacing a trigger is interesting, for several reasons:
- you may need to temporary disable a trigger. In pgAdmin2, you may move the
view to a temporary table. This can be done by other means, but none is
standard. By the way, a DISSABLE TRIGGER would be usefull.
- you may need to choose another function or change events.
- systems with server-side code need to be UPGRADED. Look at Compiere for
example. When the database schema evolves, a scripts shall be able to run
server-side and upgrade the database safely.
- newbees like to play around just as if they were in Access, Excel or MySQL.
In pgAdmin2, the graphical presentation enables them to create, move, alter
and delete objects. This is very important for someone who learns databases.
Learning becomes a game.

Inside PostgreSQL backend, I see no reason why this should not be done by a
DROP/CREATE.

Last of all, if all objects could be REPLACED or ALTERED inside PostgreSQL, it
would become interesting to create automatic Diff between revisions of a
schema. Then, PostgreSQL itself sould be able to write the upgrade script.
What do you think of this advanced feature?

Do you think it is possible to store schema dumps inside postgreSQL and
generate upgrade scripts between revisions?

Cheers,
Jean-Michel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oliver Elphick 2002-08-13 10:41:10 Re: [HACKERS] Linux Largefile Support In Postgresql RPMS
Previous Message Satoshi Nagayasu 2002-08-13 09:28:03 Is contrib/rserv/Makefile broken?

Browse pgsql-patches by date

  From Date Subject
Next Message Dave Page 2002-08-13 10:16:29 Re: CREATE OR REPLACE TRIGGER
Previous Message Denis A Ustimenko 2002-08-13 09:47:30 Re: connect_timeout parameter in libpq