Re: TODO: Add a GUC to control whether BEGIN inside

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lukas Kahwe Smith <smith(at)pooteeweet(dot)org>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: TODO: Add a GUC to control whether BEGIN inside
Date: 2007-01-02 17:33:25
Message-ID: 5932.1167759205@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Lukas Kahwe Smith <smith(at)pooteeweet(dot)org> writes:
> Err, I think you misunderstood what I said. My implementation uses
> SAVEPOINTs already. The point is having some API where you do not have
> to care of you are already in a transaction or not.

It's not that hard, is it?

if (PQtransactionStatus(conn) == PQTRANS_IDLE)
PQexec(conn, "BEGIN");
else
PQexec(conn, "SAVEPOINT foo");

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2007-01-02 17:48:22 Re: Sync Scan update
Previous Message Joshua D. Drake 2007-01-02 17:26:05 Re: TODO: Add a GUC to control whether BEGIN inside