Content-Length: 262774 | pFad | http://github.com/postgrespro/postgres/commit/5829387381d2e4edf84652bb5a712f6185860670

F2 Avoid xid error from age() function when run on Hot Standby · postgrespro/postgres@5829387 · GitHub
Skip to content

Commit 5829387

Browse files
Avoid xid error from age() function when run on Hot Standby
1 parent 773b5e0 commit 5829387

File tree

1 file changed

+4
-1
lines changed
  • src/backend/utils/adt

1 file changed

+4
-1
lines changed

src/backend/utils/adt/xid.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ Datum
9393
xid_age(PG_FUNCTION_ARGS)
9494
{
9595
TransactionId xid = PG_GETARG_TRANSACTIONID(0);
96-
TransactionId now = GetTopTransactionId();
96+
TransactionId now = GetTopTransactionIdIfAny();
97+
98+
if (!TransactionIdIsValid(now))
99+
now = ReadNewTransactionId();
97100

98101
/* Permanent XIDs are always infinitely old */
99102
if (!TransactionIdIsNormal(xid))

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/5829387381d2e4edf84652bb5a712f6185860670

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy