Re: disabling triggers?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bob Parkinson <rwp(at)biome(dot)ac(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: disabling triggers?
Date: 2000-07-18 15:56:18
Message-ID: 18218.963935778@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bob Parkinson <rwp(at)biome(dot)ac(dot)uk> writes:
> I've got a trigger/function pair that I need to disable while I do a
> manual update. Is it safe to drop the trigger, then re-create it on its
> own, or should I do the trigger/function pair.

Dropping the trigger seems sufficient. Dropping the function has at
least one big disadvantage: if the same function is supporting similar
triggers on other tables, dropping the function would break those
triggers.

> Is there a better method of temporarily disabling a trigger?

You could reach in and hack the reltriggers field in pg_class,
but dropping and recreating the trigger seems a lot cleaner and
safer.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2000-07-18 16:47:43 Re: ordering of 'where' sub clauses
Previous Message Tom Lane 2000-07-18 15:50:38 Re: ordering of 'where' sub clauses