@@ -2694,19 +2694,19 @@ usage(const char *progname)
26942694printf (_ (" -W, --pwprompt prompt for a password for the new superuser\n" ));
26952695printf (_ (" -X, --xlogdir=XLOGDIR location for the transaction log directory\n" ));
26962696printf (_ (" -x, --xid=START_XID specify start xid value in decimal format for new db instance to test 64-bit xids,\n"
2697- " default value is 0\n" ));
2697+ " default value is 0, max value is 2^62-1 \n" ));
26982698printf (_ ("\nLess commonly used options:\n" ));
26992699printf (_ (" -d, --debug generate lots of debugging output\n" ));
27002700printf (_ (" -k, --data-checksums use data page checksums\n" ));
27012701printf (_ (" -L DIRECTORY where to find the input files\n" ));
27022702printf (_ (" -m, --multixact-id=START_MX_ID\n"
27032703" specify start multixact id value in decimal format for new db instance\n"
2704- " to test 64-bit xids, default value is 0\n" ));
2704+ " to test 64-bit xids, default value is 0, max value is 2^62-1 \n" ));
27052705printf (_ (" -n, --noclean do not clean up after errors\n" ));
27062706printf (_ (" -N, --nosync do not wait for changes to be written safely to disk\n" ));
27072707printf (_ (" -o, --multixact-offset=START_MX_OFFSET\n"
27082708" specify start multixact offset value in decimal format for new db instance\n"
2709- " to test 64-bit xids, default value is 0\n" ));
2709+ " to test 64-bit xids, default value is 0, max value is 2^62-1 \n" ));
27102710printf (_ (" -s, --show show internal settings\n" ));
27112711printf (_ (" -S, --sync-only only sync data directory\n" ));
27122712printf (_ ("\nOther options:\n" ));
@@ -3471,7 +3471,14 @@ main(int argc, char *argv[])
34713471case 'm' :
34723472if (sscanf (optarg ,XID_FMT ,& start_mx_id )!= 1 )
34733473{
3474- fprintf (stderr ,"%s: invalid decimal value of multixact-id\n" ,progname );
3474+ fprintf (stderr ,"%s: invalid decimal START_MX_ID value\n" ,
3475+ progname );
3476+ exit (1 );
3477+ }
3478+ if (!StartMultiXactIdIsValid (start_mx_id ))
3479+ {
3480+ fprintf (stderr ,"%s: out-of-range START_MX_ID value (the value must be less than 2^62)\n" ,
3481+ progname );
34753482exit (1 );
34763483}
34773484break ;
@@ -3485,7 +3492,14 @@ main(int argc, char *argv[])
34853492case 'o' :
34863493if (sscanf (optarg ,XID_FMT ,& start_mx_offset )!= 1 )
34873494{
3488- fprintf (stderr ,"%s: invalid decimal value of multixact-offset\n" ,progname );
3495+ fprintf (stderr ,"%s: invalid decimal START_MX_OFFSET value\n" ,
3496+ progname );
3497+ exit (1 );
3498+ }
3499+ if (!StartMultiXactOffsetIsValid (start_mx_offset ))
3500+ {
3501+ fprintf (stderr ,"%s: out-of-range START_MX_OFFSET value (the value must be less than 2^62)\n" ,
3502+ progname );
34893503exit (1 );
34903504}
34913505break ;
@@ -3537,7 +3551,14 @@ main(int argc, char *argv[])
35373551case 'x' :
35383552if (sscanf (optarg ,XID_FMT ,& start_xid )!= 1 )
35393553{
3540- fprintf (stderr ,"%s: invalid decimal value of xid\n" ,progname );
3554+ fprintf (stderr ,"%s: invalid decimal START_XID value\n" ,
3555+ progname );
3556+ exit (1 );
3557+ }
3558+ if (!StartTransactionIdIsValid (start_xid ))
3559+ {
3560+ fprintf (stderr ,"%s: out-of-range START_XID value (the value must be less than 2^62)\n" ,
3561+ progname );
35413562exit (1 );
35423563}
35433564break ;