Re: [GENERAL] Auto-Rollback option

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: [GENERAL] Auto-Rollback option
Дата
Msg-id df49301c-1766-fccf-b742-186d78d442c3@aklaver.com
обсуждение исходный текст
Ответ на [GENERAL] Auto-Rollback option  (Małgorzata Hubert <gosiahubert@gmail.com>)
Ответы Re: [GENERAL] Auto-Rollback option  (mpomykacz <m.pomykacz@alfavox.pl>)
Список pgsql-general
On 02/13/2017 05:55 AM, Małgorzata Hubert wrote:
> Hi,
> is there any way to set Auto-Rollback : ON, automaticly during
> instalation process or using query (maybe something like set autocommit
> = 'on')?
> We need it to automaticly close the transaction if an error occures
> during implementing patches.

How are you applying the patches?

With what library/interface/etc?

For instance in psql you have:

https://www.postgresql.org/docs/9.6/static/app-psql.html
"AUTOCOMMIT

     When on (the default), each SQL command is automatically committed
upon successful completion. To postpone commit in this mode, you must
enter a BEGIN or START TRANSACTION SQL command. When off or unset, SQL
commands are not committed until you explicitly issue COMMIT or END. The
autocommit-off mode works by issuing an implicit BEGIN for you, just
before any command that is not already in a transaction block and is not
itself a BEGIN or other transaction-control command, nor a command that
cannot be executed inside a transaction block (such as VACUUM).

         Note: In autocommit-off mode, you must explicitly abandon any
failed transaction by entering ABORT or ROLLBACK. Also keep in mind that
if you exit the session without committing, your work will be lost.

         Note: The autocommit-on mode is PostgreSQL's traditional
behavior, but autocommit-off is closer to the SQL spec. If you prefer
autocommit-off, you might wish to set it in the system-wide psqlrc file
or your ~/.psqlrc file.

"

NOTE that you have to explicitly ROLLBACK a failed transaction though.

>
> Thanks in advanced for the answear.
> Best regards,
> Malgorzata Pomykacz


--
Adrian Klaver
adrian.klaver@aklaver.com


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

Предыдущее
От: Karsten Hilbert
Дата:
Сообщение: Re: [GENERAL] Auto-Rollback option
Следующее
От: Achilleas Mantzios
Дата:
Сообщение: Re: [GENERAL] Auto-Rollback option