Re: Feature discussion: Should syntax errors abort a transaction?

Поиск
Список
Период
Сортировка
От Rafal Pietrak
Тема Re: Feature discussion: Should syntax errors abort a transaction?
Дата
Msg-id 1340112919.17856.21.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: Feature discussion: Should syntax errors abort a transaction?  (Craig Ringer <craig@postnewspapers.com.au>)
Ответы Re: Feature discussion: Should syntax errors abort a transaction?  (Andrew Sullivan <ajs@crankycanuck.ca>)
Re: Feature discussion: Should syntax errors abort a transaction?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Feature discussion: Should syntax errors abort a transaction?  (Rainer Pruy <Rainer.Pruy@Acrys.COM>)
Re: Feature discussion: Should syntax errors abort a transaction?  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Список pgsql-general
On Tue, 2012-06-19 at 19:06 +0800, Craig Ringer wrote:
> On 06/19/2012 02:20 PM, Tom Lane wrote:
> > So you're suggesting that "SELECT 1/0;" should terminate a transaction,
> > but "SELECT 1//0;" should not?  How about "ROLBACK;"?  It gets pretty
> > squishy pretty fast when you try to decide which sorts of errors are
> > more important than others.
> >
> When put that way, it seems blindingly obvious. You have a talent for
> making a devastating point very succinctly.

I'd humbly disagree.

Not to drag this discussiong any further, just to make a point that the
other approach is also "blindingly obvious". Only the other way around.

The point is, that SQL syntax errors are so obviusly different from
execution errors, that noting this distinction should not raise any
ambiguity. In Tom's example "ROLBACK":
1. should not break the transaction
2. should only raise NOTICE: "syntax error"
2.1. in case this was issued from command line - user can always
ROL<TAB> to see what's next.
2.2. in case of a compiled program sending a "ROLBACK" to the
backend .... hack, the programmer should know better.
3. and BTW: what about rolling back a tediously cooked sequence of
statements finished by "COMINT"?

Things are not so obvious. And frankly, if not for the "<TAB>" I'd have
case (3) so often, that it would have driven me crasy.


-R

>
> --
> Craig Ringer
>
> POST Newspapers
> 276 Onslow Rd, Shenton Park
> Ph: 08 9381 3088     Fax: 08 9388 2258
> ABN: 50 008 917 717
> http://www.postnewspapers.com.au/
>



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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: SELECT INTO create new table, how to turn off this feature?
Следующее
От: aasat
Дата:
Сообщение: Re: SELECT INTO create new table, how to turn off this feature?