Re: [PATCHES] enable/disable trigger (Re: Fwd: Open items)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Satoshi Nagayasu <nagayasus(at)nttdata(dot)co(dot)jp>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] enable/disable trigger (Re: Fwd: Open items)
Date: 2005-08-16 02:33:37
Message-ID: 200508160233.j7G2Xbl13428@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Satoshi Nagayasu 2005-08-16 02:40:02 Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items)
Previous Message Christopher Kings-Lynne 2005-08-16 02:19:56 Re: Upcoming back-branch releases

Browse pgsql-patches by date

  From Date Subject
Next Message Satoshi Nagayasu 2005-08-16 02:40:02 Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items)
Previous Message Tom Lane 2005-08-16 02:18:15 Re: [PATCHES] enable/disable trigger (Re: Fwd: Open items)