From: Richard Huxton <dev@archonet.com>
To: sad <sad@bankir.ru>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: SET AUTOCOMMIT TO OFF
Date: Thu, 02 Dec 2004 08:56:21 +0000
Message-ID: <41AED8B5.5030302@archonet.com> (raw)
In-Reply-To: <200412020811.49435.sad@bankir.ru>
References: <41AC31F5.CE3589FB@rodos.fzk.de>
<41ADD339.6BEDFF4@rodos.fzk.de>
<8421.1101915769@sss.pgh.pa.us>
<200412020811.49435.sad@bankir.ru>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, sad@bankir.ru, tgl@sss.pgh.pa.us, ch@rodos.fzk.de
Subject: Re: SET AUTOCOMMIT TO OFF
In-Reply-To: <41AED8B5.5030302@archonet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox