Re: How to disable auto-commit in postgresql-9.4

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Nirban Sen *EXTERN*'" <sennirban89(at)gmail(dot)com>, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: How to disable auto-commit in postgresql-9.4
Date: 2015-04-21 09:30:34
Message-ID: A737B7A37273E048B164557ADEF4A58B365DC1DB@ntex2010a.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Nirban Sen wrote:
> I am using postgresql-9.4 ,but not able to disable auto-commit.So I tried to disable it using SET
> AUTOCOMMIT { = | TO } { ON | OFF } but it no twork.
> I will be grateful if you let me know as soon as possible.

The last PostgreSQL server version that had such a feature was 7.3.

Ever since, you cannot disable autocommit in PostgreSQL.

However, psql has such a feature which you can enable by
\set AUTOCOMMIT off
With that, psql will emulate "autocommit off" by automatically issuing
BEGIN before any statement if no transaction is already open.

Yours,
Laurenz Albe

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message amul sul 2015-04-21 10:38:33 Re: How to disable auto-commit in postgresql-9.4
Previous Message Nirban Sen 2015-04-21 05:32:46 How to disable auto-commit in postgresql-9.4