Re: [PATCHES] enable/disable trigger (Re: Fwd: Open items) - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [PATCHES] enable/disable trigger (Re: Fwd: Open items)
Date
Msg-id 200508160233.j7G2Xbl13428@candle.pha.pa.us
Whole thread Raw
In response to Re: [PATCHES] enable/disable trigger (Re: Fwd: Open items)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Oh, and one trick for disabling triggers in a single session is to do
> > this:
> 
> >     BEGIN WORK;
> >     ALTER TABLE xx DISABLE TRIGGER ALL
> >     ...
> >     ALTER TABLE xx ENABLE TRIGGER ALL
> >     COMMIT WORK;
> 
> > In this case, the triggers are disabled just for that session.
> 
> ... but everybody else is locked out completely, because the ALTER takes
> an exclusive lock on the table.  It's a bit misleading to describe that
> as a local change.

Oh, I had not considered that.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: Upcoming back-branch releases
Next
From: "Marc G. Fournier"
Date:
Subject: Re: Upcoming back-branch releases