Re: SET AUTOCOMMIT TO OFF - Mailing list pgsql-sql

From Richard Huxton
Subject Re: SET AUTOCOMMIT TO OFF
Date
Msg-id 41AED8B5.5030302@archonet.com
Whole thread Raw
In response to Re: SET AUTOCOMMIT TO OFF  (sad <sad@bankir.ru>)
List pgsql-sql
sad wrote:
> On Wednesday 01 December 2004 18:42, Tom Lane wrote:
> 
>>Christoph Haller <ch@rodos.fzk.de> writes:
>>
>>>Please, could someone point me to the right list
>>>or tell me how to do a "SET AUTOCOMMIT TO OFF" within libpq.
>>
>>libpq does not have any support for that.
> 
> 
> Does this mean libpq calls always uncommited or commited ?

1. Connect
2. Issue "INSERT ..."
The insert will be committed.

1. Connect
2. Issue "INSERT...; UPDATE...; INSERT...;" in one PQexec
All 3 will be committed in one transaction

1. Connect
2. Issue "BEGIN"
3. Issue "INSERT..."
4. Issue "UPDATE..."
5. Issue "INSERT..."
6. etc
Until you issue COMMIT/ROLLBACK the transaction remains open.
If you had an error at step 3, then 4,5 would fail because the 
transaction would be aborted (but waiting for you to issue ROLLBACK).

I think that covers all the combinations.
--  Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: "Iain"
Date:
Subject: Re: invalid 'having' clause
Next
From: Richard Huxton
Date:
Subject: Re: order by problem