@@ -168,6 +168,7 @@ static bool data_checksums = true;
168
168
static char * xlog_dir = NULL ;
169
169
static int wal_segment_size_mb = (DEFAULT_XLOG_SEG_SIZE ) / (1024 * 1024 );
170
170
static DataDirSyncMethod sync_method = DATA_DIR_SYNC_METHOD_FSYNC ;
171
+ static bool sync_data_files = true;
171
172
172
173
173
174
/* internal vars */
@@ -2566,6 +2567,7 @@ usage(const char *progname)
2566
2567
printf (_ (" -L DIRECTORY where to find the input files\n" ));
2567
2568
printf (_ (" -n, --no-clean do not clean up after errors\n" ));
2568
2569
printf (_ (" -N, --no-sync do not wait for changes to be written safely to disk\n" ));
2570
+ printf (_ (" --no-sync-data-files do not sync files within database directories\n" ));
2569
2571
printf (_ (" --no-instructions do not print instructions for next steps\n" ));
2570
2572
printf (_ (" -s, --show show internal settings, then exit\n" ));
2571
2573
printf (_ (" --sync-method=METHOD set method for syncing files to disk\n" ));
@@ -3208,6 +3210,7 @@ main(int argc, char *argv[])
3208
3210
{"icu-rules" , required_argument , NULL , 18 },
3209
3211
{"sync-method" , required_argument , NULL , 19 },
3210
3212
{"no-data-checksums" , no_argument , NULL , 20 },
3213
+ {"no-sync-data-files" , no_argument , NULL , 21 },
3211
3214
{NULL , 0 , NULL , 0 }
3212
3215
};
3213
3216
@@ -3402,6 +3405,9 @@ main(int argc, char *argv[])
3402
3405
case 20 :
3403
3406
data_checksums = false;
3404
3407
break ;
3408
+ case 21 :
3409
+ sync_data_files = false;
3410
+ break ;
3405
3411
default :
3406
3412
/* getopt_long already emitted a complaint */
3407
3413
pg_log_error_hint ("Try \"%s --help\" for more information." , progname );
@@ -3453,7 +3459,7 @@ main(int argc, char *argv[])
3453
3459
3454
3460
fputs (_ ("syncing data to disk ... " ), stdout );
3455
3461
fflush (stdout );
3456
- sync_pgdata (pg_data , PG_VERSION_NUM , sync_method );
3462
+ sync_pgdata (pg_data , PG_VERSION_NUM , sync_method , sync_data_files );
3457
3463
check_ok ();
3458
3464
return 0 ;
3459
3465
}
@@ -3516,7 +3522,7 @@ main(int argc, char *argv[])
3516
3522
{
3517
3523
fputs (_ ("syncing data to disk ... " ), stdout );
3518
3524
fflush (stdout );
3519
- sync_pgdata (pg_data , PG_VERSION_NUM , sync_method );
3525
+ sync_pgdata (pg_data , PG_VERSION_NUM , sync_method , sync_data_files );
3520
3526
check_ok ();
3521
3527
}
3522
3528
else
0 commit comments