Re: disabling triggers - Mailing list pgsql-sql

From Josh Berkus
Subject Re: disabling triggers
Date
Msg-id 200306171149.44425.josh@agliodbs.com
Whole thread Raw
In response to Re: disabling triggers  (<mallah@trade-india.com>)
Responses Re: disabling triggers
List pgsql-sql
Mallah,

> 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 ?

Yes.  As I said, I've used it before.

An additional safeguard you can use is enclosing everything in a transaction,
that is:

BEGIN
disable triggers
load data
enable triggers
END

--
-Josh BerkusAglio Database SolutionsSan Francisco



pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: join syntax
Next
From: "scott.marlowe"
Date:
Subject: Re: join syntax