mirror of
https://github.com/postgres/postgres.git
synced 2025-10-21 02:52:47 +03:00
Add SQL type xid8 to expose FullTransactionId to users.
Similar to xid, but 64 bits wide. This new type is suitable for use in various system views and administration functions. Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com> Reviewed-by: Takao Fujii <btfujiitkp@oss.nttdata.com> Reviewed-by: Yoshikazu Imai <imai.yoshikazu@fujitsu.com> Reviewed-by: Mark Dilger <mark.dilger@enterprisedb.com> Discussion: https://postgr.es/m/20190725000636.666m5mad25wfbrri%40alap3.anarazel.de
This commit is contained in:
@@ -47,7 +47,11 @@
|
||||
#define EpochFromFullTransactionId(x) ((uint32) ((x).value >> 32))
|
||||
#define XidFromFullTransactionId(x) ((uint32) (x).value)
|
||||
#define U64FromFullTransactionId(x) ((x).value)
|
||||
#define FullTransactionIdEquals(a, b) ((a).value == (b).value)
|
||||
#define FullTransactionIdPrecedes(a, b) ((a).value < (b).value)
|
||||
#define FullTransactionIdPrecedesOrEquals(a, b) ((a).value <= (b).value)
|
||||
#define FullTransactionIdFollows(a, b) ((a).value > (b).value)
|
||||
#define FullTransactionIdFollowsOrEquals(a, b) ((a).value >= (b).value)
|
||||
#define FullTransactionIdIsValid(x) TransactionIdIsValid(XidFromFullTransactionId(x))
|
||||
#define InvalidFullTransactionId FullTransactionIdFromEpochAndXid(0, InvalidTransactionId)
|
||||
|
||||
@@ -71,6 +75,16 @@ FullTransactionIdFromEpochAndXid(uint32 epoch, TransactionId xid)
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline FullTransactionId
|
||||
FullTransactionIdFromU64(uint64 value)
|
||||
{
|
||||
FullTransactionId result;
|
||||
|
||||
result.value = value;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* advance a transaction ID variable, handling wraparound correctly */
|
||||
#define TransactionIdAdvance(dest) \
|
||||
do { \
|
||||
|
Reference in New Issue
Block a user