Is drop/restore trigger transactional?

Поиск
Список
Период
Сортировка
От Craig James
Тема Is drop/restore trigger transactional?
Дата
Msg-id CAFwQ8rfBDpt8qsPeRigM1Fnivm4ZCdxx_yRoVYg1_4eWXuZg5w@mail.gmail.com
обсуждение исходный текст
Ответы Re: Is drop/restore trigger transactional?  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-performance
I found this discussion from 2005 that says you can drop and restore a
trigger inside a transaction, but that doing so locks the whole table:

http://archives.postgresql.org/pgsql-general/2005-01/msg01347.php
> From: Jeff Davis
>
> It got me curious enough that I tested it, and apparently droping a
> trigger locks the table. Any actions on that table must wait until the
> transaction that drops the trigger finishes.
>
> So, technically my system works, but requires a rather nasty lock while
> the transaction (the one that doesn't want the trigger to execute)
> finishes.

I have a process that copies customer data from one database to
another, and we know that the trigger has already done its work.  The
trigger is thus redundant, but it slows the copy WAY down, so I wanted
to drop/restore it inside a transaction.

Is it still true that drop-trigger inside a transaction will lock the
whole table?  We're using 8.4.

Thanks,
Craig

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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Sequential scan instead of index scan
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Is drop/restore trigger transactional?