Re: Disable Trigger - Mailing list pgsql-admin

From CoL
Subject Re: Disable Trigger
Date
Msg-id c3qaha$4oe$1@news.hub.org
Whole thread Raw
In response to Disable Trigger  (Charles Haron <charles.haron@cognitive.com>)
List pgsql-admin
hi,

Charles Haron wrote, On 3/23/2004 21:48:

> Is there a way to temporarily disable a trigger without dropping and
> re-adding it?

if you ever use dump:
pg_dump --disable-triggers ...


off:
UPDATE pg_catalog.pg_class SET reltriggers = 0 WHERE oid =
'tablename'::pg_catalog.regclass;

on:
UPDATE pg_catalog.pg_class SET reltriggers = (SELECT pg_catalog.count(*)
FROM pg_catalog.pg_trigger where pg_class.oid = tgrelid) WHERE oid =
'tablename'::pg_catalog.regclass;

C.

pgsql-admin by date:

Previous
From: alvaro@audifarma.com.co
Date:
Subject: Re: SOS ---- Could you help me with postgresql.....????
Next
From: Adam Ruth
Date:
Subject: Re: Databases Vs. Schemas