hamann.w@xxxxxxxxxxx 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.
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general