[Pljava-dev] Trigger

Thomas Hallgren thhal at mailblocks.com
Tue Jan 11 07:15:54 UTC 2005


Nageshwar Rao wrote:

>Hi,
>Now I am having a basic doubt. The trigger is after insert trigger for each
>row. When the calling function fails, there is no record inserted in the
>table. Does this mean that it is rolled back when the trigger function
>fails? 
>  
>
Using PosgreSQL versions prior to 8.0 the answer would be yes. The 
transaction is always completely rolled back when an error occurs. In 
8.0, savepoints are introduced. They give you a chance to cope with 
errors and roll back partially. A trigger can set a savepoint internally 
and roll back to that point if it fails and then continue the transaction.

Regards,
Thomas Hallgren






More information about the Pljava-dev mailing list