Re: [GENERAL] After Trigger

2006-09-22 Thread Alban Hertroys

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
[EMAIL PROTECTED]

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 //

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [GENERAL] After Trigger

2006-09-21 Thread Shane Ambler
On 22/9/2006 2:14, "Bob Pawley" <[EMAIL PROTECTED]> 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
[EMAIL PROTECTED]

Get Sheeky @ http://Sheeky.Biz



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


Re: [GENERAL] After Trigger

2006-09-21 Thread Terry Lee Tucker
On Thursday 21 September 2006 12:44 pm, Bob Pawley <[EMAIL PROTECTED]> 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
[EMAIL PROTECTED]
www.turbocorp.com

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[GENERAL] After Trigger

2006-09-21 Thread Bob Pawley



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


Re: [GENERAL] after trigger question

2001-03-22 Thread Richard Huxton

From: "Feite Brekeveld" <[EMAIL PROTECTED]>

> Stephan Szabo wrote:
>
> > On Thu, 22 Mar 2001, Feite Brekeveld wrote:
> >
> > > Hi,
> > >
> > > I have put an AFTER INSERT  TRIGGER on a table.
> > >
> > > If the triggerfunction fails to do an operation shouldn't the insert
> > > already have taken place ?
> >
> > It depends on what you mean by fails to do an operation.  If it
> > raises an actual error the transaction is going to be rolled back so the
> > insert is effectively undone.
>
> The conversion of a timestring to an integer value fails because it is
> sometimes illegal formatted , but I would like to have the the original
> data inserted in the table as a string.

Use a BEFORE INSERT trigger then to check/translate the timestring before
you insert.

- Richard Huxton


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