Re: Should we add xid_current() or a int8->xid cast?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Mark Dilger <hornschnorter(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Should we add xid_current() or a int8->xid cast?
Date: 2020-04-17 17:45:18
Message-ID: 20200417174518.ottg2kmvbjogy2lk@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2020-04-17 13:33:53 -0400, Robert Haas wrote:
> On Thu, Apr 2, 2020 at 5:13 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
> > Given that txid_current() "always" has been a plain 64 bit integer, and
> > the various txid_* functions always have returned 64 bit integers, I
> > really don't think arguing for some 32bit/32bit situation now makes
> > sense.
>
> I'm not sure what the best thing to do is here, but the reality is
> that there are many places where 32-bit XIDs are going to be showing
> up for years to come. With the format printed as a raw 64-bit
> quantity, people troubleshooting stuff are going to spend a lot of
> time figuring what x%2^32 is. And I can't do that in my head. So I
> think saying that the proposal does not makes sense is a gross
> overstatement. It may not be what we want to do. But it definitely
> would make sense.

You seem to be entirely disregarding my actual point, namely that
txid_current(), as well as some other txid_* functions, have returned
64bit xids for many many years. txid_current() is the only function to
get the current xid in a reasonable way. I don't understand how a
proposal to add a 32/32 bit representation *in addition* to the existing
32 and 64bit representations is going to improve the situation. Nor do I
see changing txid_current()'s return format as something we're going to
go for.

I did not argue against a function to turn 64bit xids into epoch/32bit
xid or such.

?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-04-17 17:46:37 Re: It is not documented that pg_promote can exit standby mode
Previous Message Robert Haas 2020-04-17 17:33:53 Re: Should we add xid_current() or a int8->xid cast?