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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Feature discussion: Should syntax errors abort a transaction?
Дата
Msg-id 4867.1340086857@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Feature discussion: Should syntax errors abort a transaction?  (Craig Ringer <craig@postnewspapers.com.au>)
Ответы Re: Feature discussion: Should syntax errors abort a transaction?  (Peter Bex <Peter.Bex@xs4all.nl>)
Re: Feature discussion: Should syntax errors abort a transaction?  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-general
Craig Ringer <craig@postnewspapers.com.au> writes:
> I've been working in psql a lot recently, and have started to wonder why
> statements with syntax errors or other problems that render them
> unexecutable terminate the transaction.

Well, the obvious reason is that it's hard to tell what the user meant,
so bailing is the safest response.

> I understand why statements that raise errors during their execution
> terminate a transaction,

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.

            regards, tom lane

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Feature discussion: Should syntax errors abort a transaction?
Следующее
От: Stefan Schwarzer
Дата:
Сообщение: Re: How to include Tablefunc as an extension