AFAIK txid_current
returns uint 64
value (source).
However, the biggest int
column type is bigint
which is signed (docs).
From what I understand, NUMERIC
type is slow and should be used "for storing monetary amounts and other quantities where exactness is required" (docs).
Should I store the txid_current
value as text
?
I need to perform mainly greater than
queries on this field:
select * from t where fxid > 438298432
What would be the most efficient (from search speed POV) for full-transaction-id (unsigned integer 64)?
Best Answer
I'm suspicious about your motivations, but I'd say you should either use bigint (which is the data type xid_current returns) or use xid (which is the internal data type for xid's). By way of example, see the following: