Обсуждение: Disabling triggers on a relation.

Поиск
Список
Период
Сортировка

Disabling triggers on a relation.

От
"Rajesh Kumar Mallah."
Дата:

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.



Re: Disabling triggers on a relation.

От
Bhuvan A
Дата:
> 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


Re: Disabling triggers on a relation.

От
"shreedhar"
Дата:
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)
>


Re: Disabling triggers on a relation.

От
"Rajesh Kumar Mallah."
Дата:
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.



Re: Disabling triggers on a relation.

От
Jack Flak
Дата:
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.