Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5829387

Browse files
Avoid xid error from age() function when run on Hot Standby
1 parent773b5e0 commit5829387

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
TransactionIdxid=PG_GETARG_TRANSACTIONID(0);
96-
TransactionIdnow=GetTopTransactionId();
96+
TransactionIdnow=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)

[8]ページ先頭

©2009-2025 Movatter.jp