December 21st, 2012, 02:37 AM
Savepoint in function?
I have the following code in a function which has a savepoint so that I can rollback all the changes made.
ROLLBACK TO SAVEPOINT my_savepoint;
But everytime I try to run this function I get the following error:
ERROR: cannot begin/end transactions in PL/pgSQL
HINT: Use a BEGIN block with an EXCEPTION clause instead.
CONTEXT: PL/pgSQL function "function2" line 3 at SQL statement