| 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 |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Richard Huxton | 2004-12-02 09:03:49 | Re: order by problem |
| Previous Message | Iain | 2004-12-02 07:46:22 | Re: invalid 'having' clause |