X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 63D56D1B196 for ; Tue, 6 Jul 2004 20:54:03 -0300 (ADT) 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 46567-09 for ; Tue, 6 Jul 2004 23:54:05 +0000 (GMT) Received: from esri3.esri.com (dwp.esri.com [198.102.62.250]) by svr1.postgresql.org (Postfix) with ESMTP id C00ACD1B1D5 for ; Tue, 6 Jul 2004 20:53:58 -0300 (ADT) Received: from zipwire.esri.com (zipwire.esri.com [46.1.2.224]) by esri3.esri.com (8.11.6+Sun/8.11.6) with ESMTP id i66Ns0108426 for ; Tue, 6 Jul 2004 16:54:00 -0700 (PDT) Received: by zipwire.esri.com with Internet Mail Service (5.5.2657.72) id ; Tue, 6 Jul 2004 16:51:00 -0700 Message-ID: <491DC5F3D279CD4EB4B157DDD62237F404E27EFD@zipwire.esri.com> From: Brijesh Shrivastav To: PostgreSQL Interfaces Subject: Libpq and transactions Date: Tue, 6 Jul 2004 16:50:49 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/12 X-Sequence-Number: 5018 Hi! I have a question about how transaction behaves in libpq library. It is very clear in doc that PQexec treats each command (which could comprise of more than one sql command) as a single transactions. Does PQexecParams() and PQexecPrepared() also behaves the same? Is there a way to send multiple sql commands separately through libpq library and rollback if nth command fails. For example, Can I insert 5 rows using PQexecParams() and rollback all 5 rows if sixth insert fails? Regards, Brijesh