On Sat, Jul 03, 2004 at 11:03:33AM -0400, Tom Lane wrote:
> than begin/commit for subxacts? What about savepoints?) Also, what about
> exposing this functionality in plpgsql? Seems like we need some kind of
> exception handling syntax to make this useful. What does Oracle do?
Oracle uses savepoints:
SAVEPOINT savepointname;
creates a savepoint or shifts existing savepoint of the same name;
ROLLBACK TO savepointname;
rolls back to savepoint (more verbose syntax also available);
The syntax of handling exceptions is (in PL/SQL):
BEGIN
some code, for example a bunch of SQL commands;
EXCEPTION
WHEN nameofexception THEN
handle the exception, maybe ROLLBACK;
END;
There are predefined exceptions like INVALID_NUMBER, NO_DATA_FOUND,
ZERO_DIVIDE, or OTHERS.
--
------------------------------------------------------------------------
Honza Pazdziora | [EMAIL PROTECTED] | http://www.fi.muni.cz/~adelton/
.project: Perl, mod_perl, DBI, Oracle, large Web systems, XML/XSL, ...
Only self-confident people can be simple.
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings