[SQL] Disabling triggers/constraints pg<8.1

2006-02-26 Thread Bath, David
Folks, Questions about disabling/enabling triggers/constraints "through the back door" in pg versions that do not support DISABLE|ENABLE of such things? Background: pg 8.1 has the ability to DISABLE/ENABLE a particular trigger, and it looks like we'll be getting DISABLE/ENABLE CONSTRAINT stat

Re: [SQL] disabling triggers

2003-09-01 Thread weigelt
On Tue, Jun 17, 2003 at 11:49:44AM -0700, Josh Berkus wrote: I also need something like that for my replication stuff: When data from another node comes it, it should be written directly to the tables, without any (unwanted) triggers firering. On the other hand, in "normal" mode, also some mi

Re: [SQL] disabling triggers

2003-06-17 Thread Josh Berkus
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

Re: [SQL] disabling triggers

2003-06-17 Thread mallah
> 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 wh

Re: [SQL] disabling triggers

2003-06-17 Thread Josh Berkus
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

[SQL] disabling triggers

2003-06-17 Thread mallah
Hi, Is setting reltriggers=0 on pg_class an accepatble way of disabling triggers on a table temporarily? secondly is it worth having commands like alter trigger inactive; alter trigger active ; i feel such commands exists on Oracle. sometime we need to bulk update tables from backdoor and we

Re: [SQL] disabling triggers

2003-06-17 Thread Josh Berkus
Mallah, > Is setting reltriggers=0 on pg_class an accepatble way of > disabling triggers on a table temporarily? Yes. pg_dump does this. > secondly is it worth having commands like > alter trigger inactive; > alter trigger active ; > i feel such commands exists on Oracle. No, since DROP TRI

Re: [SQL] disabling triggers

2003-06-17 Thread mallah
> 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. > > Yes. pg_dump does this. > >> secondly is it worth having commands like >> alter trigger inactive; >> alter trigger act