Re: ALTER TRIGGER Before / After?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: ALTER TRIGGER Before / After?
Дата
Msg-id 47265FB8.9020105@archonet.com
обсуждение исходный текст
Ответ на ALTER TRIGGER Before / After?  (Josh Trutwin <josh@trutwins.homeip.net>)
Ответы Re: ALTER TRIGGER Before / After?  (Josh Trutwin <josh@trutwins.homeip.net>)
Список pgsql-general
Josh Trutwin wrote:
> On Postgresql 8.1 I am guessing there isn't a convenient way to alter
> a trigger to change its before/after behavior?  I wrote one of my
> first triggers using an AFTER and now I release I needed to
> do BEFORE.  It's used on a couple tables so I was hoping to avoid
> dropping it and re-creating it but if that is my only option, so be
> it.

What's the problem with drop/create?

BEGIN;
DROP TRIGGER...
CREATE TRIGGER...
COMMIT;

No other activity needs to be interrupted.

A common trick is to put these changes in a script with a ROLLBACK at
the end. That way you can run the script, look for errors and only put
the commit at the end once it all works.


--
   Richard Huxton
   Archonet Ltd

В списке pgsql-general по дате отправления:

Предыдущее
От: Josh Trutwin
Дата:
Сообщение: ALTER TRIGGER Before / After?
Следующее
От: Joseph S
Дата:
Сообщение: Re: DST problem on pg 8.2.5