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 Berkus
Aglio Database Solutions
San Francisco