Re: catching errors in function - Mailing list pgsql-sql

From Eugene E.
Subject Re: catching errors in function
Date
Msg-id 4344CE37.2090407@bankir.ru
Whole thread Raw
In response to catching errors in function  ("padmanabha konkodi" <konkodi221@rediffmail.com>)
List pgsql-sql
> i have written function in which while executing it may throw error.
> if the error thrown i want rollback the transaction if not i want commit.


BEGIN;
SELECT you_function(args);
...
many sql commands;
...
COMMIT;

that's all

if your function raises an error
whole transaction will be aborted when the COMMIT is called.


pgsql-sql by date:

Previous
From: "padmanabha konkodi"
Date:
Subject: catching errors in function
Next
From: xchris
Date:
Subject: Noob question about types and lists