Re: Virtual tx id - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: Virtual tx id
Date
Msg-id 20220921042110.2akmfffhy6f3fdpe@jrouhaud
Whole thread Raw
In response to Virtual tx id  (James Sewell <james.sewell@gmail.com>)
List pgsql-hackers
Hi,

On Wed, Sep 21, 2022 at 01:58:47PM +1000, James Sewell wrote:
> Hello Hackers!
>
> Is it possible to get the current virtual txid from C somehow?
>
> 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?

It should be MyProc->lxid, and prepend it with MyBackendId if you want to
compare something like pg_locks.virtualtransaction.



pgsql-hackers by date:

Previous
From: Zhang Mingli
Date:
Subject: Re: Virtual tx id
Next
From: Nathan Bossart
Date:
Subject: Re: predefined role(s) for VACUUM and ANALYZE