Re: Proper way to keep count of statements executed within current transaction

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: "Podrigal, Aron" <aronp(at)guaranteedplus(dot)com>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: Proper way to keep count of statements executed within current transaction
Date: 2019-05-24 20:56:18
Message-ID: D736EE9B-27AB-42F9-BB04-D0887C758594@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

> On May 24, 2019, at 13:49, Podrigal, Aron <aronp(at)guaranteedplus(dot)com> wrote:
>
> My question is, what is the correct way to detect whether any statements were executed successfully prior to the connection being lost.

You can't. This is exactly why you have transactions: In the case of a lost connection, you can assume the transaction was aborted, and retry the transaction from the start.

--
-- Christophe Pettus
xof(at)thebuild(dot)com

In response to

Browse psycopg by date

  From Date Subject
Next Message Thomas Güttler 2019-06-04 08:56:16 Re: Log Stacktrace of current Python Interpreter via PostgreSQL trigger
Previous Message Podrigal, Aron 2019-05-24 20:49:04 Proper way to keep count of statements executed within current transaction