Savepoints in PL/pgSQL - Mailing list pgsql-general

From BigSmoke
Subject Savepoints in PL/pgSQL
Date
Msg-id 1166540710.237718.91170@80g2000cwy.googlegroups.com
Whole thread Raw
Responses Re: Savepoints in PL/pgSQL  (Bernd Helmle <mailings@oopsware.de>)
List pgsql-general
I understand that due to a lack of nested transaction support, it is
not possible to use START TRANSACTION within a PL/PgSQL function. What
I, however, do not understand is why I can't use SAVEPOINT either. I'm
writing long test functions wherein, at the start of the function, I'd
like to define all test data followed by a "SAVEPOINT
fresh_test_data;". Will this become possible in the (near) future? I
mean, savepoints are of limited use to me if they imply that I can't
stick my tests in stored procedures.

On a side note: I've seen a comment on this list that the error message
of trying to use a SAVEPOINT in PL/pgSQL isn't too clear (compared with
the error message for using SAVEPOINT in an SQL function). I can second
this. However, I noticed that the message is much clearer when you
EXECUTE the SAVEPOINT command.


pgsql-general by date:

Previous
From: John McCawley
Date:
Subject: Re: Creating an Independant Application
Next
From: Shane Ambler
Date:
Subject: Re: Let's play bash the search engine