Re: [PATCH] bigint txids vs 'xid' type, new txid_recent(bigint) => xid

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] bigint txids vs 'xid' type, new txid_recent(bigint) => xid
Date: 2016-08-18 18:35:23
Message-ID: ac8e3f41-49ae-4aba-d1d4-138ae66dd7c0@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/18/16 5:46 AM, Amit Kapila wrote:
> I think there is a value in exposing such a variant which takes bigint
> and internally converts it to xid. I am not sure the semantics for

I think that's a bad idea because you have the exact same problems we
have now: bigint is signed, epoch is not.

> the other proposal txid_recent() is equivalent to what we have for
> txid_current(). One thing which is different is that txid_current()
> allocates a new transaction if there is currently none. If you

Right, and it would be nice to be able to tell if an XID has been
assigned to your transaction or not; something you currently can't do.

> plainly want to convert it to 32 bit xid, then may be txid_convert or
> something like that is more suitable.

I think we need to either add real types for handling XID/epoch/TXID or
finally create uint types. It's *way* too easy to screw things up the
way they are today.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532) mobile: 512-569-9461

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-08-18 18:39:59 Re: Use pread and pwrite instead of lseek + write and read
Previous Message Stephen Frost 2016-08-18 18:31:58 Re: Add -c to rsync commands on SR tutorial wiki page