Re: ROLLBACK, SAVEPOINT, COMMIT throwing error in transaction block. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: ROLLBACK, SAVEPOINT, COMMIT throwing error in transaction block.
Date
Msg-id 20855.1298040506@sss.pgh.pa.us
Whole thread Raw
In response to ROLLBACK, SAVEPOINT, COMMIT throwing error in transaction block.  ("Jaiswal Dhaval Sudhirkumar" <JaiswalDS@microland.com>)
List pgsql-bugs
"Jaiswal Dhaval Sudhirkumar" <JaiswalDS@microland.com> writes:
> ERROR: SPI_execute_plan_with_paramlist failed executing query "SAVEPOINT my_savepoint": SPI_ERROR_TRANSACTION

This is not a bug.  It's an extremely well-documented limitation that
you can't use those commands in a plpgsql function.

You can get the effect of a savepoint using a BEGIN/EXCEPTION block.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Euler Taveira de Oliveira
Date:
Subject: Re: BUG #5878: BTREE_BUILD_STATS causes 'make check' to fail
Next
From: Tom Lane
Date:
Subject: Re: postgresql 9.0.3: parallel restore fails with comments on indices