Re: Running query without trigger?

Поиск
Список
Период
Сортировка
От Berend Tober
Тема Re: Running query without trigger?
Дата
Msg-id 5780AE71.8050402@computer.org
обсуждение исходный текст
Ответ на Running query without trigger?  (hamann.w@t-online.de)
Список pgsql-general
hamann.w@t-online.de wrote:
>
> Hi,
>
> a table is associated with a trigger for normal use.
> An admin (someone with ALTER privilege) can disable tthe trigger, run some bulk update,
> and then re-enable it. This means, however, that  normal user activity has to be locked out.
>
> There are two possible scenarios: the bulk update would not cause trigger activity at all,
> because of the values and columns involved.
> or - the bulk update is followed by another bulk transaction that  is equivalent to trigger
> invocations per row.
> At least in the first case, running this particular query without triggering the trigger,
> but normal activity still going on, would be really great
> Is there a way to achieve this?


For UPDATE events, it is possible to specify a list of columns using this syntax:

UPDATE OF column_name1 [, column_name2 ... ]

The trigger will only fire if at least one of the listed columns is mentioned as a target of the
UPDATE command.


So, if you use that optional syntax, then since as you described it, the columns in your update
statement would not be included in the "OF" list and hence not fire this update trigger. Meanwhile,
normal updates, presumably which did involve columns in the "OF" list, would appropriately fire the
trigger as required.






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

Предыдущее
От: "Charles Clavadetscher"
Дата:
Сообщение: Re: Running query without trigger?
Следующее
От: Christian Elmerot
Дата:
Сообщение: Re: Running query without trigger?