pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: CoL <col@mportal.hu>
To: pgsql-admin@postgresql.org
Subject: Re: Disable Trigger
Date: Tue, 23 Mar 2004 22:37:20 +0100
Message-ID: <c3qaha$4oe$1@news.hub.org> (raw)
In-Reply-To: <686B4177-7D0B-11D8-AD18-000A95AA0B44@cognitive.com>
References: <686B4177-7D0B-11D8-AD18-000A95AA0B44@cognitive.com>

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.



view thread (3+ messages)  latest in thread

Message-ID: <c3qaha$4oe$1@news.hub.org>
Permalink:  ../c3qaha$4oe$1@news.hub.org/
Also on:    postgresql.org/message-id/c3qaha$4oe$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: col@mportal.hu
  Subject: Re: Disable Trigger
  In-Reply-To: <c3qaha$4oe$1@news.hub.org>
  References: <686B4177-7D0B-11D8-AD18-000A95AA0B44@cognitive.com> <c3qaha$4oe$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox