Re: disable/enable trigger hangs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mike Charnoky <noky(at)nextbus(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: disable/enable trigger hangs
Date: 2007-03-28 16:48:55
Message-ID: 3973.1175100535@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mike Charnoky <noky(at)nextbus(dot)com> writes:
> First, a question: For a PG8.1 database, is it preferable to use the new
> "alter table disable|enable trigger" command as opposed to the old
> method of setting pg_class.reltriggers = 0?

Very much so --- manual manipulation of reltriggers has never been
anything but a dangerous kluge.

> I'm assuming the "alter table" approach is preferred, so I converted
> some scripts to use the new method. However, sometimes the
> enable/disable trigger command hangs when operating on certain tables.
> I use the syntax "ALTER TABLE mytable DISABLE TRIGGER ALL;". Any hints
> on how to debug this?

Look in pg_locks to see who's got a lock on the table. One of the
reasons the pg_class update is a kluge is exactly that it ignores
locking considerations ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alain Roger 2007-03-28 17:02:40 how to know a table size ?
Previous Message Tom Lane 2007-03-28 16:43:50 Re: How does filter order relate to query optimization?