From: mallah@trade-india.com
To: josh@agliodbs.com
Cc: pgsql-sql@postgresql.org
Subject: Re: disabling triggers
Date: Wed, 18 Jun 2003 00:17:46 +0530 (IST)
Message-ID: <1182.219.65.230.103.1055875666.squirrel@mail.trade-india.com> (raw)
In-Reply-To: <200306171131.24578.josh@agliodbs.com>
References: <1164.219.65.230.103.1055871254.squirrel@mail.trade-india.com>
<200306171058.44814.josh@agliodbs.com>
<1175.219.65.230.103.1055873842.squirrel@mail.trade-india.com>
<200306171131.24578.josh@agliodbs.com>
> 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.
in past we tried creating a plpgsql function that takes relname and schema
and try setting reltriggers=0 on disabling and = (select count(*) from pg_trigger
for that relname and schema) on enabling .
we got stuck somewhere and abandoned it , do u think above approach
would work in principle ?
i will retry it tommorw though and post the results.
regds
mallah.
>
> --
> -Josh Berkus
> Aglio Database Solutions
> San Francisco
>
>
> ---------------------------(end of broadcast)--------------------------- TIP 3: if
> posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your message can get through
> to the mailing list cleanly
-----------------------------------------
Get your free web based email at trade-india.com.
"India's Leading B2B eMarketplace.!"
http://www.trade-india.com/
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mallah@trade-india.com, josh@agliodbs.com
Subject: Re: disabling triggers
In-Reply-To: <1182.219.65.230.103.1055875666.squirrel@mail.trade-india.com>
* 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