From: | Markus Schaber <schabi(at)logix-tt(dot)com> |
---|---|
To: | Henry Ortega <juandelacruz(at)gmail(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Make Trigger run after completion of ENTIRE transaction |
Date: | 2006-09-20 09:24:14 |
Message-ID: | 451108BE.5090905@logix-tt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hi, Henry,
Henry Ortega wrote:
> This maybe more of a theoretical question, can you actually make a
> Trigger run
> after completion of the entire transaction?
[...]
> ........... another 20-30 more inserts..........
Which frontend do yu use? Maybe COPY is better than insert.
> The trigger actually runs on each Insert and therefore slows down the
> Insert quite a bit.
This sounds like the trigger itsself could be optimized a bit, or does
some work that is not best suited to be in a trigger.
> My question is, can you tell the trigger to run after Commit?
I assume the trigger has to do some integrity checking work?
Could you reformulate it as foreign key or check constraints? (you may
even call a complex plpgsql function from the check constraint). Most
constraint checks can be deferred to the end of the transaction, see the
docs for more details.
HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org
From | Date | Subject | |
---|---|---|---|
Next Message | Harald Fuchs | 2006-09-20 11:33:01 | Re: Need a SQL to create sets of hobbies |
Previous Message | CN | 2006-09-20 05:18:39 | Need a SQL to create sets of hobbies |