Re: SET AUTOCOMMIT OFF

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: SET AUTOCOMMIT OFF
Дата
Msg-id 4B540723.1070005@postnewspapers.com.au
обсуждение исходный текст
Ответ на SET AUTOCOMMIT OFF  (<A.Bhattacharya@sungard.com>)
Список pgsql-general
A.Bhattacharya@sungard.com wrote:
> Hi All,
>
>
>
> I am new to Postgresql and I need to turn off the AUTO COMMIT in
> PostgreSQL 8.3.Can anyone guide me how to do it as SET AUTOCOMMIT = off;
> does not seem to be supported any more in PostgreSQL 8.3.

Just explicitly begin a transaction, like you do in most databases:

BEGIN;
INSERT ...
UPDATE ...
COMMIT;

Are you perhaps using PostgreSQL from JDBC or ODBC? If so, those client
interfaces provide their own ways to manage the "autocommit" setting -
which internally just tells the driver to create a transaction and not
commit it until you ask it to.

One thing to understand by the way: If you're not running a statement in
an explicit transaction, it just creates its own transaction when it
starts, runs, then commits automatically when it finishes. There's no
functional difference between:

BEGIN;
INSERT ...;
COMMIT;

and a stand-alone:

INSERT ...;


--
Craig Ringer

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: SET AUTOCOMMIT OFF
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: postgres external table