Unix Technical Forum

Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items)

This is a discussion on Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items) within the Pgsql Patches forums, part of the PostgreSQL category; --> On Fri, 1 Jul 2005, Satoshi Nagayasu wrote: > Hi all, > > Here is a first patch to ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:35 AM
Gavin Sherry
 
Posts: n/a
Default Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items)

On Fri, 1 Jul 2005, Satoshi Nagayasu wrote:

> Hi all,
>
> Here is a first patch to allow these commands.
>
> > ALTER TABLE <table> ENABLE TRIGGER <trigname>
> > ALTER TABLE <table> DISABLE TRIGGER <trigname>

>


Hmmm.. just thinking about it for a second. I wonder if we should also
support:

ALTER TABLE DISABLE TRIGGERS

which would disable all triggers on the table. We would have a
complimentary ENABLE TRIGGERS as well, obviously. The reason I say this is
that the common case will be that people are doing a bulk load and want to
disable all triggers. However, this will be very useful for debugging
interactions between triggers on a table so a user might want to disable
only one of many triggers -- as your current grammar does.

Perhaps a way of making the grammar a little less ambiguous would be to
have the following to disable all triggers:

ALTER TABLE <table> DISABLE TRIGGERS

and the following to disable one:

ALTER TRIGGER <trigger> DISABLE


Just an idea.

Thanks,

Gavin

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 12:35 AM
Satoshi Nagayasu
 
Posts: n/a
Default Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items)

Hi,

Gavin Sherry wrote:
> Hmmm.. just thinking about it for a second. I wonder if we should also
> support:
>
> ALTER TABLE DISABLE TRIGGERS


I found some RDBMSes are supporting 'DISABLE TRIGGER ALL TRIGGERS' command.

Does anyone know about the SQL99 spec?

--
NAGAYASU Satoshi <nagayasus@nttdata.co.jp>

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 12:35 AM
Gavin Sherry
 
Posts: n/a
Default Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items)

On Fri, 1 Jul 2005, Satoshi Nagayasu wrote:

> Hi,
>
> Gavin Sherry wrote:
> > Hmmm.. just thinking about it for a second. I wonder if we should also
> > support:
> >
> > ALTER TABLE DISABLE TRIGGERS

>
> I found some RDBMSes are supporting 'DISABLE TRIGGER ALL TRIGGERS' command.
>
> Does anyone know about the SQL99 spec?


The spec says nothing about disabling triggers.

Gavin

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 12:35 AM
Bruce Momjian
 
Posts: n/a
Default Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items)

Gavin Sherry wrote:
> On Fri, 1 Jul 2005, Satoshi Nagayasu wrote:
>
> > Hi all,
> >
> > Here is a first patch to allow these commands.
> >
> > > ALTER TABLE <table> ENABLE TRIGGER <trigname>
> > > ALTER TABLE <table> DISABLE TRIGGER <trigname>

> >

>
> Hmmm.. just thinking about it for a second. I wonder if we should also
> support:
>
> ALTER TABLE DISABLE TRIGGERS
>
> which would disable all triggers on the table. We would have a
> complimentary ENABLE TRIGGERS as well, obviously. The reason I say this is
> that the common case will be that people are doing a bulk load and want to
> disable all triggers. However, this will be very useful for debugging
> interactions between triggers on a table so a user might want to disable
> only one of many triggers -- as your current grammar does.
>
> Perhaps a way of making the grammar a little less ambiguous would be to
> have the following to disable all triggers:
>
> ALTER TABLE <table> DISABLE TRIGGERS
>
> and the following to disable one:
>
> ALTER TRIGGER <trigger> DISABLE


The proposed syntax in TODO.detail/trigger is:

ALTER TABLE foo {DISABLE|ENABLE} TRIGGER { ALL | trigger_name [ ,... ] };

which would cleanly allow all triggers of a table to be disabled.

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:12 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com