mirror of
https://github.com/postgres/postgres.git
synced 2026-03-07 07:40:31 -05:00
Avoid xid error from age() function when run on Hot Standby
This commit is contained in:
parent
14c412da46
commit
d02918fc3e
1 changed files with 4 additions and 1 deletions
|
|
@ -93,7 +93,10 @@ Datum
|
|||
xid_age(PG_FUNCTION_ARGS)
|
||||
{
|
||||
TransactionId xid = PG_GETARG_TRANSACTIONID(0);
|
||||
TransactionId now = GetTopTransactionId();
|
||||
TransactionId now = GetTopTransactionIdIfAny();
|
||||
|
||||
if (!TransactionIdIsValid(now))
|
||||
now = ReadNewTransactionId();
|
||||
|
||||
/* Permanent XIDs are always infinitely old */
|
||||
if (!TransactionIdIsNormal(xid))
|
||||
|
|
|
|||
Loading…
Reference in a new issue