Skip site navigation (1) Skip section navigation (2)

Re: SET AUTOCOMMIT TO OFF

From: Richard Huxton <dev(at)archonet(dot)com>
To: sad <sad(at)bankir(dot)ru>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Christoph Haller <ch(at)rodos(dot)fzk(dot)de>,pgsql-sql(at)postgresql(dot)org
Subject: Re: SET AUTOCOMMIT TO OFF
Date: 2004-12-02 08:56:21
Message-ID: 41AED8B5.5030302@archonet.com (view raw or flat)
Thread:
Lists: pgsql-sql
sad wrote:
> On Wednesday 01 December 2004 18:42, Tom Lane wrote:
> 
>>Christoph Haller <ch(at)rodos(dot)fzk(dot)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

In response to

pgsql-sql by date

Next:From: Richard HuxtonDate: 2004-12-02 09:03:49
Subject: Re: order by problem
Previous:From: IainDate: 2004-12-02 07:46:22
Subject: Re: invalid 'having' clause

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group