On Fri, 2005-08-26 at 13:13 -0400, Nicholas Walker wrote: > >You can't use savepoints, you can trap errors which is implemented using > >savepoints. You still might want to write code like this: > > > >BEGIN > > > >.... > > > >SAVEPOINT foo; > > > >.... > > > >IF SOME_ERROR_CODE = 1234 THEN > > ROLLBACK TO SAVEPOINT foo; > >END > > > >... > I agree, and I think savepoints would be much more usefull if you could > call them from pl/pgsql...
Maybe if PL/pgSQL had user-defined exceptions then the language's identity of savepoints and exception blocks would be a little easier to work with. Is anything happening with the patch for user-defined exceptions, posted at http://archives.postgresql.org/pgsql-patches/2005-06/msg00475.php (and also discussed elsewhere)? ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster