Re: [GENERAL] Auto-Rollback option - Mailing list pgsql-general

From Adrian Klaver
Subject Re: [GENERAL] Auto-Rollback option
Date
Msg-id ae33b3b6-2a68-a72e-97a8-bdd861072edf@aklaver.com
Whole thread Raw
In response to Re: [GENERAL] Auto-Rollback option  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
On 02/13/2017 09:59 AM, John R Pierce wrote:
> On 2/13/2017 7:15 AM, mpomykacz wrote:
>> So my problem is like this:
>>
>> I start the transaction with BEGIN TRANSACTION;
>> Then I have for example some INSERTs to DB
>> and at the end COMMIT; and END TRANSACTION;
>
> COMMIT ends the transaction.   In PostgreSQL, END TRANSACTION is
> redundant, equivalent to COMMIT, do one or the other, not both.
>
>>
>> But if one of this INSERTs causes error, the transaction will stop
>> (but it
>> is still open and next patch is implemented within the same transaction).
>
> Patch ?
>
>>
>> When I turn the Auto-Rollback on everything is ok : in situation like
>> this
>> my transaction is automatically rollbacked and closed.
>
> there is no autorollback option in standard PostgreSQL ?

Forgot to add, in pgAdmin3 there is:

https://www.pgadmin.org/docs/1.22/options-query_tool.html?highlight=rollback

Enable Auto ROLLBACK - Check the box next to Enable Auto ROLLBACK to
instruct the query tool to execute a ROLLBACK if a query fails.


>
>>
>> But I do not want to do the Auto-Rollback click manualy in the Option
>> menu
>> or query editor window (because I can not be sure that the person who
>> will
>> run the patch would remember about this click).
>
> option?   query editor window?     what software are you talking about?
>
>> I'm using 1.22.1 version.
>
> 1.22.1 version?     PostgreSQL versions currently supported are 9.2.x to
> 9.6.x
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: [GENERAL] Auto-Rollback option
Next
From: Moreno Andreo
Date:
Subject: Re: [GENERAL] Auto-Rollback option