Savepoints in PL/pgSQL

From: "BigSmoke" <bigsmoke(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Savepoints in PL/pgSQL
Date: 2006-12-19 15:05:10
Message-ID: 1166540710.237718.91170@80g2000cwy.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shane Ambler 2006-12-19 15:05:57 Re: Let's play bash the search engine
Previous Message John McCawley 2006-12-19 15:03:12 Re: Creating an Independant Application