Re: BEGIN inside transaction should be an error - Mailing list pgsql-hackers

From Tom Lane
Subject Re: BEGIN inside transaction should be an error
Date
Msg-id 25861.1147310651@sss.pgh.pa.us
Whole thread Raw
In response to Re: BEGIN inside transaction should be an error  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: BEGIN inside transaction should be an error  ("Jaime Casanova" <systemguards@gmail.com>)
Re: BEGIN inside transaction should be an error  (Dennis Bjorklund <db@zigo.dhs.org>)
Re: BEGIN inside transaction should be an error  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> How do other database deal with this? Either they nest BEGIN/COMMIT or
> they probably throw an error without aborting the transaction, which is
> pretty much what we do. Is there a database that actually aborts a
> whole transaction just for an extraneous begin?

Probably not.  The SQL99 spec does say (in describing START TRANSACTION,
which is the standard spelling of BEGIN)
        1) If a <start transaction statement> statement is executed when an           SQL-transaction is currently
active,then an exception condition           is raised: invalid transaction state - active SQL-transaction.
 

*However*, they are almost certainly expecting that that condition only
causes the START command to be ignored; not that it should bounce the
whole transaction.  So I think the argument that this is required by
the spec is a bit off base.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PERFORM] Big IN() clauses etc : feature proposal
Next
From: Tom Lane
Date:
Subject: Re: .pgpass file and unix domain sockets