disable triggers and lock table
579400Jan 11 2008 — edited Jan 11 2008Hi,
I have a requirement to update a column in a table without executing the associated triggers on that table. Also, no other session(s) can insert or update data in the table during the update.
I was thinking of doing the following:
ALTER TABLE t
DISABLE ALL TRIGGERS;
LOCK TABLE t IN EXCLUSIVE MODE NOWAIT;
-- perform the UPDATE
ALTER TABLE t
ENABLE ALL TRIGGERS;
Does this guarantee that no data can be updated/inserted during the update or is it possible that between the disabling of the trigger and the locking of the table a session can insert/update data? Or is there a better way to do this ?