Re: Information on savepoint requirement within transctions

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Information on savepoint requirement within transctions
Дата
Msg-id CAKFQuwaZYdDU3MGvgESVvzGz81sEy9kvNmHevOEG3J3Bee6zZg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Information on savepoint requirement within transctions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Information on savepoint requirement within transctions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Mon, Jan 29, 2018 at 8:33 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
What we do have though is client-side support for appropriate behaviors.
In psql, see the AUTOCOMMIT and ON_ERROR_ROLLBACK control variables.
Other interfaces such as JDBC have their own ideas about how this ought
to work.

​Not quite the same.  I think what people probably want is for psql to recognize it is in a transaction and before sending a command to the server for processing to precede it by sending "SAVEPOINT random()".  Then, before returning the result of the command to the user issue either "RELEASE SAVEPOINT" or "ROLLBACK TO SAVEPOINT" depending on whether the command succeeded or failed.  Then report the result to the user.

Having a GUC to instruct the server to do that instead sounds appealing as a user, or middle-ware writer, though I couldn't see doing it given today's GUC mechanics for the same reason the AUTOCOMMIT GUC was removed.

David J.

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

Предыдущее
От: Seth Goldin
Дата:
Сообщение: Which specific flags to use for bash client applications for DaVinci Resolve?
Следующее
От: Matej
Дата:
Сообщение: Re: PG Sharding