@@ -144,6 +144,9 @@ static bool sync_only = false;
144
144
static bool show_setting = false;
145
145
static bool data_checksums = false;
146
146
static char * xlog_dir = "" ;
147
+ static TransactionId start_xid = 0 ;
148
+ static MultiXactId start_mx_id = 0 ;
149
+ static MultiXactOffset start_mx_offset = 0 ;
147
150
148
151
149
152
/* internal vars */
@@ -1535,9 +1538,12 @@ bootstrap_template1(void)
1535
1538
unsetenv ("PGCLIENTENCODING" );
1536
1539
1537
1540
snprintf (cmd , sizeof (cmd ),
1538
- "\"%s\" --boot -x1 %s %s %s" ,
1541
+ "\"%s\" --boot -x1 %s %s " HEX_XID_FMT " %s " HEX_XID_FMT " %s " XID_FMT " %s %s" ,
1539
1542
backend_exec ,
1540
1543
data_checksums ? "-k" : "" ,
1544
+ "-X" , start_xid ,
1545
+ "-m" , start_mx_id ,
1546
+ "-o" , start_mx_offset ,
1541
1547
boot_options , talkargs );
1542
1548
1543
1549
PG_CMD_OPEN ;
@@ -2683,16 +2689,24 @@ usage(const char *progname)
2683
2689
printf (_ (" --no-locale equivalent to --locale=C\n" ));
2684
2690
printf (_ (" --pwfile=FILE read password for the new superuser from file\n" ));
2685
2691
printf (_ (" -T, --text-search-config=CFG\n"
2686
- " default text search configuration\n" ));
2692
+ " default text search configuration\n" ));
2687
2693
printf (_ (" -U, --username=NAME database superuser name\n" ));
2688
2694
printf (_ (" -W, --pwprompt prompt for a password for the new superuser\n" ));
2689
2695
printf (_ (" -X, --xlogdir=XLOGDIR location for the transaction log directory\n" ));
2696
+ printf (_ (" -x, --xid=START_XID specify start xid value in hex format for new db instance to test 64-bit xids,\n"
2697
+ " default value is 0\n" ));
2690
2698
printf (_ ("\nLess commonly used options:\n" ));
2691
2699
printf (_ (" -d, --debug generate lots of debugging output\n" ));
2692
2700
printf (_ (" -k, --data-checksums use data page checksums\n" ));
2693
2701
printf (_ (" -L DIRECTORY where to find the input files\n" ));
2702
+ printf (_ (" -m, --multixact-id=START_MX_ID\n"
2703
+ " specify start multixact id value in hex format for new db instance\n"
2704
+ " to test 64-bit xids, default value is 0\n" ));
2694
2705
printf (_ (" -n, --noclean do not clean up after errors\n" ));
2695
2706
printf (_ (" -N, --nosync do not wait for changes to be written safely to disk\n" ));
2707
+ printf (_ (" -o, --multixact-offset=START_MX_OFFSET\n"
2708
+ " specify start multixact offset value in decimal format for new db instance\n"
2709
+ " to test 64-bit xids, default value is 0\n" ));
2696
2710
printf (_ (" -s, --show show internal settings\n" ));
2697
2711
printf (_ (" -S, --sync-only only sync data directory\n" ));
2698
2712
printf (_ ("\nOther options:\n" ));
@@ -3371,6 +3385,9 @@ main(int argc, char *argv[])
3371
3385
{"nosync" , no_argument , NULL , 'N' },
3372
3386
{"sync-only" , no_argument , NULL , 'S' },
3373
3387
{"xlogdir" , required_argument , NULL , 'X' },
3388
+ {"xid" , required_argument , NULL , 'x' },
3389
+ {"multixact-id" , required_argument , NULL , 'm' },
3390
+ {"multixact-offset" , required_argument , NULL , 'o' },
3374
3391
{"data-checksums" , no_argument , NULL , 'k' },
3375
3392
{NULL , 0 , NULL , 0 }
3376
3393
};
@@ -3412,7 +3429,7 @@ main(int argc, char *argv[])
3412
3429
3413
3430
/* process command-line options */
3414
3431
3415
- while ((c = getopt_long (argc , argv , "dD:E:kL:nNU:WA:sST:X:" , long_options , & option_index )) != -1 )
3432
+ while ((c = getopt_long (argc , argv , "dD:E:kL:m: nNU:WA:o: sST:X:x :" , long_options , & option_index )) != -1 )
3416
3433
{
3417
3434
switch (c )
3418
3435
{
@@ -3451,13 +3468,27 @@ main(int argc, char *argv[])
3451
3468
debug = true;
3452
3469
printf (_ ("Running in debug mode.\n" ));
3453
3470
break ;
3471
+ case 'm' :
3472
+ if (sscanf (optarg , HEX_XID_FMT , & start_mx_id ) != 1 )
3473
+ {
3474
+ fprintf (stderr , "%s: invalid hex value of multixact-id\n" , progname );
3475
+ exit (1 );
3476
+ }
3477
+ break ;
3454
3478
case 'n' :
3455
3479
noclean = true;
3456
3480
printf (_ ("Running in noclean mode. Mistakes will not be cleaned up.\n" ));
3457
3481
break ;
3458
3482
case 'N' :
3459
3483
do_sync = false;
3460
3484
break ;
3485
+ case 'o' :
3486
+ if (sscanf (optarg , XID_FMT , & start_mx_offset ) != 1 )
3487
+ {
3488
+ fprintf (stderr , "%s: invalid decimal value of multixact-offset\n" , progname );
3489
+ exit (1 );
3490
+ }
3491
+ break ;
3461
3492
case 'S' :
3462
3493
sync_only = true;
3463
3494
break ;
@@ -3503,6 +3534,13 @@ main(int argc, char *argv[])
3503
3534
case 'X' :
3504
3535
xlog_dir = pg_strdup (optarg );
3505
3536
break ;
3537
+ case 'x' :
3538
+ if (sscanf (optarg , HEX_XID_FMT , & start_xid ) != 1 )
3539
+ {
3540
+ fprintf (stderr , "%s: invalid hex value of xid\n" , progname );
3541
+ exit (1 );
3542
+ }
3543
+ break ;
3506
3544
default :
3507
3545
/* getopt_long already emitted a complaint */
3508
3546
fprintf (stderr , _ ("Try \"%s --help\" for more information.\n" ),
0 commit comments