Re: Current transaction is aborted, commands ignored until end of transaction block

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: Current transaction is aborted, commands ignored until end of transaction block
Дата
Msg-id jdqfis$4kr$2@reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на Current transaction is aborted, commands ignored until end of transaction block  (Jan Bakuwel <jan.bakuwel@greenpeace.org>)
Список pgsql-sql
On 2011-12-30, Jan Bakuwel <jan.bakuwel@greenpeace.org> wrote:
> This is a cryptographically signed message in MIME format.
>

> What annoys me is that I don't think that a constraint violation made by
> a user should result in an aborted transaction. There is probably a very
> good reason to do that however the logic escapes me...

the reason for it is it allows several updates (or other DML) to be
run without checking for success and then success only checked at the
commit stage. this makes it easier to the DBA to enforce databse
consistancy against wayward applications and not suffer from partial
inserts.

> Of course I can start testing existing values in the database before
> accepting them in the user interface but that's putting the horse behind
> the cart. I much rather use the constraints at the database level to
> tell me a particular update can't be done and do that without loosing
> everything else I happened to have done in that transaction until that
> point.
>
> Any suggestions?

checkpoints can probably do what you want, but long-lived transactions 
are a bad idea in general, especially if you expect to have several 
physical users accessing your database simultaneously. 

-- 
⚂⚃ 100% natural



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

Предыдущее
От: Misa Simic
Дата:
Сообщение: Re: Current transaction is aborted, commands ignored until endof transaction block
Следующее
От: vinodh chowdary
Дата:
Сообщение: i want small information regarding postgres