Re: disabling triggers

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: <mallah(at)trade-india(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: disabling triggers
Date: 2003-06-17 18:31:24
Message-ID: 200306171131.24578.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Mallah,

> >> Is setting reltriggers=0 on pg_class an accepatble way of
> >> disabling triggers on a table temporarily?
>
> Ok , but someone on list was scary few months back.

I've done it many times without a problem. The trick is re-setting the
triggers to the correct number when you're done. See the scripts that
pg_dump -a creates for a good example.

> Agreed , but there is no easy way to view current trigger defination of
> existing triggers before dropping from psql .

So? Create a perl script. It can:
1) query the system tables to find out the trigger definintion
(you'll need pg_trigger, pg_proc, and pg_type)
2) generate a script to restore all the triggers to be used later;
3) drop all the triggers

Of course, setting reltriggers=0 is probably a lot easier.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-06-17 18:43:02 Re: [HACKERS] Our FLOAT(p) precision does not conform to spec
Previous Message mallah 2003-06-17 18:17:22 Re: disabling triggers