Обсуждение: How to disable auto-commit in postgresql-9.4

Поиск
Список
Период
Сортировка

How to disable auto-commit in postgresql-9.4

От
Nirban Sen
Дата:
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.




--
With Best Regards,,
Nirban Sen
+91-9614612152

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

От
Albe Laurenz
Дата:
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


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

От
amul sul
Дата:
If you are using psql as client, simply add the following line to ~/.psqlrc:

\set AUTOCOMMIT off


Regards,
Amul Sul



On Tuesday, 21 April 2015 2:11 PM, Nirban Sen <sennirban89@gmail.com> 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.



--

With Best Regards,,
Nirban Sen
+91-9614612152