Re: [SQL] [TRIGGER] Returning values from BEFORE UPDATE trigger, without using them

2010-07-27 Thread Torsten Zühlsdorff
Tom Lane schrieb: =?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= writes: I have defined an BEFORE UPDATE trigger. The trigger catch every update, change some columns of the new row, make an insert of the new row and returns null to abort the update. Why in the world would you do that? Just return t

Re: [SQL] [TRIGGER] Returning values from BEFORE UPDATE trigger, without using them

2010-07-27 Thread Tom Lane
=?ISO-8859-15?Q?Torsten_Z=FChlsdorff?= writes: > I have defined an BEFORE UPDATE trigger. The trigger catch every update, > change some columns of the new row, make an insert of the new row and > returns null to abort the update. Why in the world would you do that? Just return the modified row

Re: [SQL] [TRIGGER] Returning values from BEFORE UPDATE trigger, without using them

2010-07-26 Thread Torsten Zühlsdorff
Hey Dmitriy, thanks for your reply. I think, its would be better to use rule on update instead of the trigger in such case as you. I've played the whole weekend with the rule-system, but it didn't work for my case. I have a dynamic trigger, which takes cares about revision of rows for every

[SQL] [TRIGGER] Returning values from BEFORE UPDATE trigger, without using them

2010-07-23 Thread Torsten Zühlsdorff
Hello, i have a non-trival problem and i do not believe that it is solvable. I have defined an BEFORE UPDATE trigger. The trigger catch every update, change some columns of the new row, make an insert of the new row and returns null to abort the update. All fine till here :) Now the problem: