Re: Nested Transaction TODO list

From: Honza Pazdziora <adelton(at)informatics(dot)muni(dot)cz>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nested Transaction TODO list
Date: 2004-07-07 07:16:22
Message-ID: 20040707071622.GD11905@anxur.fi.muni.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 | adelton(at)fi(dot)muni(dot)cz | http://www.fi.muni.cz/~adelton/
.project: Perl, mod_perl, DBI, Oracle, large Web systems, XML/XSL, ...
Only self-confident people can be simple.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-07-07 07:19:34 Re: ALTER xxx SET TABLESPACE (was bug in DROP TABLESPACE)
Previous Message Andreas Pflug 2004-07-07 07:07:53 ALTER xxx SET TABLESPACE (was bug in DROP TABLESPACE)