Re: in failed sql transaction

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: in failed sql transaction
Дата
Msg-id 20060924234009.GA43233@winnie.fuhr.org
обсуждение исходный текст
Ответ на in failed sql transaction  (Ralf Wiebicke <ralf.wiebicke@exedio.com>)
Ответы Re: in failed sql transaction  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
Список pgsql-general
On Sun, Sep 24, 2006 at 12:03:59PM +0200, Ralf Wiebicke wrote:
> I just realized the following behaviour in postgresql: when I violate any
> constraint (unique constraint in my case) then the transaction is not usable
> anymore. Any other sql command returns a "in failed sql transaction" error.

Transactions are all-or-nothing: all statements must succeed or the
transaction fails (but see below regarding savepoints).

> All other databases I used up to now just ignore the statement violating the
> constraint, but leave the transaction intact.

Which databases behave that way?  Does COMMIT succeed even if some
statements failed?

> Is this intended behaviour or rather a bug? Or is there any way to "switch on"
> the behaviour I'd like to see?

This is intended behavior.  You can use savepoints to roll back
part of a transaction so the transaction can continue after an
error.

--
Michael Fuhr

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

Предыдущее
От: Bob Pawley
Дата:
Сообщение: Re: serial column
Следующее
От: Markus Grabner
Дата:
Сообщение: query rewrite rules for updateable views?