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

Commite3679bc

Browse files
committed
pg_resetwal: Corrections around -c option
The present pg_resetwal code hardcodes the minimum value for -c as 2,which is FrozenTransactionId, but it's not clear why that is allowed.After some research, it was probably a mistake in the original patch.Change it to FirstNormalTransactionId, which matches other xid-relatedoptions in pg_resetwal.Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>Discussion:https://www.postgresql.org/message-id/flat/d09f0e91-8757-642b-1a92-da9a52f5589a%40eisentraut.org
1 parent1d91d24 commite3679bc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎src/bin/pg_resetwal/pg_resetwal.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ main(int argc, char *argv[])
211211
exit(1);
212212
}
213213

214-
if (set_oldest_commit_ts_xid<2&&
215-
set_oldest_commit_ts_xid!=0)
216-
pg_fatal("transaction ID (-c) must be either0 or greater than or equal to2");
214+
if (set_oldest_commit_ts_xid<FirstNormalTransactionId&&
215+
set_oldest_commit_ts_xid!=InvalidTransactionId)
216+
pg_fatal("transaction ID (-c) must be either%u or greater than or equal to%u",InvalidTransactionId,FirstNormalTransactionId);
217217

218-
if (set_newest_commit_ts_xid<2&&
219-
set_newest_commit_ts_xid!=0)
220-
pg_fatal("transaction ID (-c) must be either0 or greater than or equal to2");
218+
if (set_newest_commit_ts_xid<FirstNormalTransactionId&&
219+
set_newest_commit_ts_xid!=InvalidTransactionId)
220+
pg_fatal("transaction ID (-c) must be either%u or greater than or equal to%u",InvalidTransactionId,FirstNormalTransactionId);
221221
break;
222222

223223
case'o':

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp