pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Disabling triggers on a relation.
5+ messages / 4 participants
[nested] [flat]

* Disabling triggers on a relation.
@ 2002-11-30 21:22  Rajesh Kumar Mallah. <mallah@trade-india.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Rajesh Kumar Mallah. @ 2002-11-30 21:22 UTC (permalink / raw)
  To: pgsql-admin



Hi ,

What is the correct method of temporarily
disabling all triggers from a table?


also is there any command/function  to show the 
trigger defination ? like pg_index_def does for indexes?


regds
mallah.

-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Disabling triggers on a relation.
@ 2002-12-02 09:46  Bhuvan A <bhuvansql@myrealbox.com>
  parent: Rajesh Kumar Mallah. <mallah@trade-india.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Bhuvan A @ 2002-12-02 09:46 UTC (permalink / raw)
  To: pgsql-admin


> What is the correct method of temporarily
> disabling all triggers from a table?

Disable: 
db=# update pg_class set reltriggers = '0' where relname = 'your_table';

Enable:
db=# update pg_class set reltriggers = (select count(*) from pg_trigger 
where pg_class.oid = tgrelid) where relname = 'your_table';

> 
> 
> also is there any command/function  to show the 
> trigger defination ? like pg_index_def does for indexes?
> 

Not sure.

regards,
bhuvaneswaran




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Disabling triggers on a relation.
@ 2002-12-04 18:55  Jack Flak <jack@flak.nospam.org>
  parent: Rajesh Kumar Mallah. <mallah@trade-india.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Jack Flak @ 2002-12-04 18:55 UTC (permalink / raw)
  To: pgsql-admin

Greetings Raj,

I found this to be helpful:
  SELECT tgname, tgenabled AS tf, tgconstrname  FROM pg_trigger ;


Rajesh Kumar Mallah. wrote:

> Hi ,
> 
> What is the correct method of temporarily
> disabling all triggers from a table?
> 
> 
> also is there any command/function  to show the
> trigger defination ? like pg_index_def does for indexes?
> 
> 
> regds
> mallah.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Disabling triggers on a relation.
@ 2002-12-05 04:54  shreedhar <shreedhar@lucidindia.net>
  parent: Bhuvan A <bhuvansql@myrealbox.com>
  0 siblings, 1 reply; 5+ messages in thread

From: shreedhar @ 2002-12-05 04:54 UTC (permalink / raw)
  To: Bhuvan A <bhuvansql@myrealbox.com>; pgsql-admin

Hi Bhuvan & Mallah,

Have you checked desabling of triggers. What reltriggers represent. If we
set it as '0' to enable by what value it has to be updated.

Sreedhar
----- Original Message -----
From: "Bhuvan A" <bhuvansql@myrealbox.com>
To: <pgsql-admin@postgresql.org>
Sent: Monday, December 02, 2002 3:16 PM
Subject: Re: [ADMIN] Disabling triggers on a relation.


>
> > What is the correct method of temporarily
> > disabling all triggers from a table?
>
> Disable:
> db=# update pg_class set reltriggers = '0' where relname = 'your_table';
>
> Enable:
> db=# update pg_class set reltriggers = (select count(*) from pg_trigger
> where pg_class.oid = tgrelid) where relname = 'your_table';
>
> >
> >
> > also is there any command/function  to show the
> > trigger defination ? like pg_index_def does for indexes?
> >
>
> Not sure.
>
> regards,
> bhuvaneswaran
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Disabling triggers on a relation.
@ 2002-12-05 12:33  Rajesh Kumar Mallah. <mallah@trade-india.com>
  parent: shreedhar <shreedhar@lucidindia.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Rajesh Kumar Mallah. @ 2002-12-05 12:33 UTC (permalink / raw)
  To: shreedhar <shreedhar@lucidindia.net>; Bhuvan A <bhuvansql@myrealbox.com>; pgsql-admin


by total no of triggers that relation has,
which is got from a subselct on pg_triggers

On Thursday 05 December 2002 10:24 am, shreedhar wrote:
> Hi Bhuvan & Mallah,
>
> Have you checked desabling of triggers. What reltriggers represent. If we
> set it as '0' to enable by what value it has to be updated.
>
> Sreedhar
> ----- Original Message -----
> From: "Bhuvan A" <bhuvansql@myrealbox.com>
> To: <pgsql-admin@postgresql.org>
> Sent: Monday, December 02, 2002 3:16 PM
> Subject: Re: [ADMIN] Disabling triggers on a relation.
>
> > > What is the correct method of temporarily
> > > disabling all triggers from a table?
> >
> > Disable:
> > db=# update pg_class set reltriggers = '0' where relname = 'your_table';
> >
> > Enable:
> > db=# update pg_class set reltriggers = (select count(*) from pg_trigger
> > where pg_class.oid = tgrelid) where relname = 'your_table';
> >
> > > also is there any command/function  to show the
> > > trigger defination ? like pg_index_def does for indexes?
> >
> > Not sure.
> >
> > regards,
> > bhuvaneswaran
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
> ---------------------------(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

-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2002-12-05 12:33 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-11-30 21:22 Disabling triggers on a relation. Rajesh Kumar Mallah. <mallah@trade-india.com>
2002-12-02 09:46 ` Bhuvan A <bhuvansql@myrealbox.com>
2002-12-05 04:54   ` shreedhar <shreedhar@lucidindia.net>
2002-12-05 12:33     ` Rajesh Kumar Mallah. <mallah@trade-india.com>
2002-12-04 18:55 ` Jack Flak <jack@flak.nospam.org>

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