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)
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
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
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:
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