Re: [SQL] Is there any way to stop triggers from cycling?

2006-03-09 Thread Richard Huxton
Josh Berkus wrote: Folks, I'm experimenting with a set of triggers to automagically maintain ltrees-organized tables. I almost have it working, except for a pesky problem with re-ordering groups. The idea is that I want to set up a set of triggers such that: a) If the user moves item (1)

[SQL] Is there any way to stop triggers from cycling?

2006-03-08 Thread Josh Berkus
Folks, I'm experimenting with a set of triggers to automagically maintain ltrees-organized tables. I almost have it working, except for a pesky problem with re-ordering groups. The idea is that I want to set up a set of triggers such that: a) If the user moves item (1) to item (3), then the

Re: [SQL] Is there any way to stop triggers from cycling?

2006-03-08 Thread Rod Taylor
I'm experimenting with a set of triggers to automagically maintain ltrees-organized tables. I almost have it working, except for a pesky problem with re-ordering groups. Currently I'm doing this by only cascade-updating the row adjacent to the one I'm moving. However, this is resulting

Re: [SQL] Is there any way to stop triggers from cycling?

2006-03-08 Thread chester c young
trying to do this exlusively in triggers is a forray into folly. take advantage of instead of or do also rules to create a compound statement before your triggers do their work. (in terms of maintenance and sanity, it's best if a trigger touches only its own record.) as a handsweep example:

Re: [SQL] Is there any way to stop triggers from cycling?

2006-03-08 Thread Josh Berkus
Chester, take advantage of instead of or do also rules to create a compound statement before your triggers do their work. (in terms of maintenance and sanity, it's best if a trigger touches only its own record.) Ah, I see ... so: 1) create a view on the table 2) put a rule on the view to