Re: BEGIN inside transaction should be an error

Поиск
Список
Период
Сортировка
От Mario Weilguni
Тема Re: BEGIN inside transaction should be an error
Дата
Msg-id 200605120916.44495.mweilguni@sime.com
обсуждение исходный текст
Ответ на Re: BEGIN inside transaction should be an error  (Simon Riggs <simon@2ndquadrant.com>)
Ответы Re: BEGIN inside transaction should be an error  ("Jaime Casanova" <systemguards@gmail.com>)
Список pgsql-hackers
Am Donnerstag, 11. Mai 2006 22:16 schrieb Simon Riggs:
> On Wed, 2006-05-10 at 21:24 -0400, Tom Lane wrote:
> > 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.
>
> If you interpret the standard that way then the correct behaviour in the
> face of *any* exception condition should be *not* abort the transaction.
> In PostgreSQL, all exception conditions do abort the transaction, so why
> not this one? Why would we special-case this?

IMO it's ok to raise an exception - if this is configurable for at least one 
releasy cycle - giving developers time to fix applications. It's no good 
behaviour to change something like this without any (at least time-limited ) 
backward compatible option.

regardsmario weilguni


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Qingqing Zhou"
Дата:
Сообщение: Re: EXPLAIN verbose?
Следующее
От: Thomas Hallgren
Дата:
Сообщение: any, anyelement, and anyarray