Re: Nested Transactions, Abort All

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, Oliver Jowett <oliver(at)opencloud(dot)com>, Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>, Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>, Zeugswetter Andreas SB SD <ZeugswetterA(at)spardat(dot)at>, Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Nested Transactions, Abort All
Date: 2004-07-10 20:36:58
Message-ID: 200407101336.58954.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce,

> Well, Oracle doesn't suppor RELEASE, so we are matching the standard but
> perhaps not allowing easy migration from Oracle.

Well, that's Oracle's problem. Considering the amount of influence they had
over the standard, there's no excuse for their syntax. Also, if someone
converts and Oracle script which does not do RELEASE, it's still ok with us;
they just end up nesting multiple levels and not "releasing" until the main
transaction is committed.

> Don't we see the error from libpq PQexec() return value and other
> interfaces?

As far as I know, DBD::pg does not at this time; it detects an error but does
not return the SQLSTATE, and I'm *sure* that PHP 4 does not. I'm sure there
are other interfaces in the same boat. And nobody has answered the question
of what SQLSTATE ranges indicate an abort state as opposed to something else
-- I get the feeling that this is not at all defined.

> Are you saying how do we detect a failure from a psql
> script?

Right. There are applications out there: shell scripts, ODBC applications,
etc., which are unlikely to *ever* have the ability to read states from
libpq. These applications need to have the ability to detect an abort *by
query* ala T-SQL (e.g. the @@ERROR system variable), so that they can issue
the proper ROLLBACKs.

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dennis Bjorklund 2004-07-10 20:39:48 Re: Nested Transactions, Abort All
Previous Message Bruce Momjian 2004-07-10 20:34:26 Re: Nested Transactions, Abort All