fix xid_age function show negative result if there be big gap

This commit is contained in:
movead
2024-04-02 10:54:13 +08:00
committed by yaoxin
parent 75873b55dd
commit 56d92b1903

View File

@ -178,9 +178,9 @@ Datum xid_age(PG_FUNCTION_ARGS)
/* Permanent XIDs are always infinitely old */
if (!TransactionIdIsNormal(xid))
PG_RETURN_INT64(INT64_MAX);
PG_RETURN_TRANSACTIONID(UINT64_MAX);
PG_RETURN_INT64((int64)(now - xid));
PG_RETURN_TRANSACTIONID((TransactionId)(now - xid));
}
/*