Thread: After Trigger
I am seeking wording for a procedure that will initiate a trigger only after another trigger has completed its function. In this case I want to drop a table that is created and used by the first trigger.
Could someone point me to documentation?
Bob Pawley
On Thursday 21 September 2006 12:44 pm, Bob Pawley <rjpawley@shaw.ca> thus communicated: --> I am seeking wording for a procedure that will initiate a trigger only after another trigger has completed its function. In this case I want to drop a table that is created and used by the first trigger. --> --> Could someone point me to documentation? --> --> Bob Pawley According to the 7.4.6 docs: "If more than one trigger is defined for the same event on the same relation, the triggers will be fired in alphabetical order by trigger name. In the case of before triggers, the possibly-modified row returned by each trigger becomes the input to the next trigger. If any before trigger returns a NULL pointer, the operation is abandoned and subsequent triggers are not fired. " So, name the last trigger you want to fire such that it falls aphabetically behind the rest. -- Terry Tucker Turbo's IT Manager Turbo, division of Ozburn-Hessey Logistics 2251 Jesse Jewell Pkwy NE Gainesville, GA 30501 Tel: (336) 372-6812 Fax: (336) 372-6812 Cell: (336) 363-4719 terry@esc1.com www.turbocorp.com
On 22/9/2006 2:14, "Bob Pawley" <rjpawley@shaw.ca> wrote: > I am seeking wording for a procedure that will initiate a trigger only after > another trigger has completed its function. In this case I want to drop a > table that is created and used by the first trigger. Sounds like you should use a temporary table. CREATE TEMP TABLE mytmptable (...... This table will just disappear shortly after your trigger is finished. -- Shane Ambler Postgres@007Marketing.com Get Sheeky @ http://Sheeky.Biz
Bob Pawley wrote: > > I am seeking wording for a procedure that will initiate a trigger only > after another trigger has completed its function. In this case I want to > drop a table that is created and used by the first trigger. You could just call a function from your trigger, or handle it inside the trigger. An alternative approach would be to use a permanent table, fill it within your transaction and trunk it eventually. To other transactions there'll never be any data in it, and you lose the overhead of creating and dropping the table (replacing it by trunking...). -- Alban Hertroys alban@magproductions.nl magproductions b.v. T: ++31(0)534346874 F: ++31(0)534346876 M: I: www.magproductions.nl A: Postbus 416 7500 AK Enschede // Integrate Your World //