Re: How to determine that a TransactionId is really aborted?

From: Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>
To: Eric Ridge <eebbrr(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)bowt(dot)ie>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How to determine that a TransactionId is really aborted?
Date: 2017-10-22 20:50:04
Message-ID: CAJGNTeNaBNsKNPdyh9FgwY7FvhRn7nm-4J8_Wxx2z-bmrimGSw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 22 October 2017 at 15:00, Eric Ridge <eebbrr(at)gmail(dot)com> wrote:
>> On Oct 22, 2017, at 1:50 PM, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
>>
>> On Sun, Oct 22, 2017 at 12:23 PM, Eric Ridge <eebbrr(at)gmail(dot)com> wrote:
>>> Can anyone confirm or deny that this is correct? I feel like it is correct, but I'm no expert.
>>
>> What are you going to use the code for? I think that that context is
>> likely to matter here.
>
> I'm not exactly sure yet, but I'm thinking about storing transaction ids externally and then regularly poking Postgres to see which ones are aborted-and-no-longer-considered-visible so I can clean up my external list.
>

so, what you want is txid_status() [1]... while this is new in v10 you
can use the code as guide or just migrate to v10 ;)

[1] https://www.postgresql.org/docs/10/static/functions-info.html#functions-txid-snapshot

--
Jaime Casanova www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-10-22 21:11:09 Re: BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much
Previous Message Andrew Dunstan 2017-10-22 20:50:00 Re: BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much