X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DB74D3A597C for ; Thu, 2 Dec 2004 21:09:39 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09265-07 for ; Thu, 2 Dec 2004 21:09:34 +0000 (GMT) Received: from www.postgresql.com (unknown [200.46.204.209]) by svr1.postgresql.org (Postfix) with ESMTP id 696BC3A5998 for ; Thu, 2 Dec 2004 21:08:30 +0000 (GMT) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by www.postgresql.com (Postfix) with ESMTP id 82AB673B3CA for ; Thu, 2 Dec 2004 08:56:22 +0000 (GMT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-32.mail.demon.net with esmtp (Exim 4.42) id 1CZmlD-000OQB-7Z; Thu, 02 Dec 2004 08:56:23 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id B108F162AD; Thu, 2 Dec 2004 08:56:21 +0000 (GMT) Message-ID: <41AED8B5.5030302@archonet.com> Date: Thu, 02 Dec 2004 08:56:21 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: sad Cc: Tom Lane , Christoph Haller , pgsql-sql@postgresql.org Subject: Re: SET AUTOCOMMIT TO OFF References: <41AC31F5.CE3589FB@rodos.fzk.de> <41ADD339.6BEDFF4@rodos.fzk.de> <8421.1101915769@sss.pgh.pa.us> <200412020811.49435.sad@bankir.ru> In-Reply-To: <200412020811.49435.sad@bankir.ru> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.129 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200412/25 X-Sequence-Number: 19645 sad wrote: > On Wednesday 01 December 2004 18:42, Tom Lane wrote: > >>Christoph Haller 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