Re: Error on failed COMMIT

Поиск
Список
Период
Сортировка
От Vladimir Sitnikov
Тема Re: Error on failed COMMIT
Дата
Msg-id CAB=Je-HV4Pm8Wt_KuLyEEOVMNsGX3UEY5zH-S1c9jd7CKx8pgA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Error on failed COMMIT  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Error on failed COMMIT  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert>Now, of course, it's also true that if what the server does makes
Robert>users sad, maybe the server should do something different

The server makes users sad as it reports the same end result (=="commit failed") differently.
Sometimes the server produces ERROR, and sometimes the server produces "OK, the transaction was rolled back".

The users do expect that commit might fail, and they don't really expect that sometimes commit can be silently converted to a rollback.

Robert>BEGIN;
Robert>-- do stuff
Robert>COMMIT;
Robert>BEGIN;
Robert>-- do more stuff
Robert>COMMIT;

Robert>...and they run these scripts by piping them into psql. Now, if the
Robert>COMMIT leaves the session in a transaction state,

Noone suggested that "commit leaves the session in a transaction state".
Of course, every commit should terminate the transaction.
However, if a commit fails (for any reason), it should produce the relevant ERROR that explains what went wrong rather than silently doing a rollback.

Vladimir

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: plan cache overhead on plpgsql expression
Следующее
От: Antonin Houska
Дата:
Сообщение: RS_EPHEMERAL vs RS_TEMPORARY