Libpq and transactions

From: Brijesh Shrivastav <Bshrivastav(at)esri(dot)com>
To: PostgreSQL Interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Libpq and transactions
Date: 2004-07-06 23:50:49
Message-ID: 491DC5F3D279CD4EB4B157DDD62237F404E27EFD@zipwire.esri.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Greg Stark 2004-07-07 01:27:45 Re: pgin.tcl pg_exec_prepared slow (was: Released...)
Previous Message Tom Lane 2004-07-06 02:43:47 Re: pgin.tcl pg_exec_prepared slow (was: Released...)