Re: Virtual tx id

From: Japin Li <japinli(at)hotmail(dot)com>
To: James Sewell <james(dot)sewell(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Virtual tx id
Date: 2022-09-21 04:17:19
Message-ID: MEYP282MB16690CEDF379EF15F1B0BE20B64F9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Wed, 21 Sep 2022 at 11:58, James Sewell <james(dot)sewell(at)gmail(dot)com> wrote:
> Hello Hackers!
>
> Is it possible to get the current virtual txid from C somehow?
>
The virtual txid is consisted of MyProc->backendId and MyProc->lxid. Do you
mean a C function that returns virtual txid?

> I've looked through the code, but can't seem to find anything other than
> getting a NULL when there is no (real) xid assigned. Maybe I'm missing
> something?
>
Do you mean use SQL function to check the virtual? IIRC, there is no such
functions. Maybe you can use pg_export_snapshot() to get virtual txid (v10
and later), the filename of exported snapshot consists MyProc->backendId
and MyProc->lxid.

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhang Mingli 2022-09-21 04:19:46 Re: Virtual tx id
Previous Message James Sewell 2022-09-21 03:58:47 Virtual tx id