@@ -208,7 +208,8 @@ sub filter_dump
208
208
209
209
# Load the dump using the "postgres" database as "regression" does
210
210
# not exist yet, and we are done here.
211
- $oldnode -> command_ok([ ' psql' , ' -X' , ' -f' , $olddumpfile , ' postgres' ],
211
+ $oldnode -> command_ok(
212
+ [ ' psql' , ' --no-psqlrc' , ' --file' => $olddumpfile , ' postgres' ],
212
213
' loaded old dump file' );
213
214
}
214
215
else
@@ -303,14 +304,15 @@ sub filter_dump
303
304
my @command_args = ();
304
305
for my $upcmd (@{ $adjust_cmds -> {$updb } })
305
306
{
306
- push @command_args , ' -c ' , $upcmd ;
307
+ push @command_args , ' --command ' => $upcmd ;
307
308
}
308
309
309
310
# For simplicity, use the newer version's psql to issue the commands.
310
311
$newnode -> command_ok(
311
312
[
312
- ' psql' , ' -X' , ' -v' , ' ON_ERROR_STOP=1' ,
313
- ' -d' , $oldnode -> connstr($updb ),
313
+ ' psql' , ' --no-psqlrc' ,
314
+ ' --set' => ' ON_ERROR_STOP=1' ,
315
+ ' --dbname' => $oldnode -> connstr($updb ),
314
316
@command_args ,
315
317
],
316
318
" ran version adaptation commands for database $updb " );
@@ -324,8 +326,9 @@ sub filter_dump
324
326
# Take a dump before performing the upgrade as a base comparison. Note
325
327
# that we need to use pg_dumpall from the new node here.
326
328
my @dump_command = (
327
- ' pg_dumpall' , ' --no-sync' , ' -d' , $oldnode -> connstr(' postgres' ),
328
- ' -f' , $dump1_file );
329
+ ' pg_dumpall' , ' --no-sync' ,
330
+ ' --dbname' => $oldnode -> connstr(' postgres' ),
331
+ ' --file' => $dump1_file );
329
332
# --extra-float-digits is needed when upgrading from a version older than 11.
330
333
push (@dump_command , ' --extra-float-digits' , ' 0' )
331
334
if ($oldnode -> pg_version < 12);
@@ -399,13 +402,13 @@ sub filter_dump
399
402
command_checks_all(
400
403
[
401
404
' pg_upgrade' , ' --no-sync' ,
402
- ' -d ' , $oldnode -> data_dir,
403
- ' -D ' , $newnode -> data_dir,
404
- ' -b ' , $oldbindir . ' /does/not/exist/' ,
405
- ' -B ' , $newbindir ,
406
- ' -s ' , $newnode -> host,
407
- ' -p ' , $oldnode -> port,
408
- ' -P ' , $newnode -> port,
405
+ ' --old-datadir ' => $oldnode -> data_dir,
406
+ ' --new-datadir ' => $newnode -> data_dir,
407
+ ' --old-bindir ' => $oldbindir . ' /does/not/exist/' ,
408
+ ' --new-bindir ' => $newbindir ,
409
+ ' --socketdir ' => $newnode -> host,
410
+ ' --old-port ' => $oldnode -> port,
411
+ ' --new-port ' => $newnode -> port,
409
412
$mode , ' --check' ,
410
413
],
411
414
1,
@@ -427,13 +430,13 @@ sub filter_dump
427
430
command_checks_all(
428
431
[
429
432
' pg_upgrade' , ' --no-sync' ,
430
- ' -d ' , $oldnode -> data_dir,
431
- ' -D ' , $newnode -> data_dir,
432
- ' -b ' , $oldbindir ,
433
- ' -B ' , $newbindir ,
434
- ' -s ' , $newnode -> host,
435
- ' -p ' , $oldnode -> port,
436
- ' -P ' , $newnode -> port,
433
+ ' --old-datadir ' => $oldnode -> data_dir,
434
+ ' --new-datadir ' => $newnode -> data_dir,
435
+ ' --old-bindir ' => $oldbindir ,
436
+ ' --new-bindir ' => $newbindir ,
437
+ ' --socketdir ' => $newnode -> host,
438
+ ' --old-port ' => $oldnode -> port,
439
+ ' --new-port ' => $newnode -> port,
437
440
$mode , ' --check' ,
438
441
],
439
442
1,
@@ -451,10 +454,14 @@ sub filter_dump
451
454
# --check command works here, cleans up pg_upgrade_output.d.
452
455
command_ok(
453
456
[
454
- ' pg_upgrade' , ' --no-sync' , ' -d' , $oldnode -> data_dir,
455
- ' -D' , $newnode -> data_dir, ' -b' , $oldbindir ,
456
- ' -B' , $newbindir , ' -s' , $newnode -> host,
457
- ' -p' , $oldnode -> port, ' -P' , $newnode -> port,
457
+ ' pg_upgrade' , ' --no-sync' ,
458
+ ' --old-datadir' => $oldnode -> data_dir,
459
+ ' --new-datadir' => $newnode -> data_dir,
460
+ ' --old-bindir' => $oldbindir ,
461
+ ' --new-bindir' => $newbindir ,
462
+ ' --socketdir' => $newnode -> host,
463
+ ' --old-port' => $oldnode -> port,
464
+ ' --new-port' => $newnode -> port,
458
465
$mode , ' --check' ,
459
466
],
460
467
' run of pg_upgrade --check for new instance' );
@@ -464,10 +471,14 @@ sub filter_dump
464
471
# Actual run, pg_upgrade_output.d is removed at the end.
465
472
command_ok(
466
473
[
467
- ' pg_upgrade' , ' --no-sync' , ' -d' , $oldnode -> data_dir,
468
- ' -D' , $newnode -> data_dir, ' -b' , $oldbindir ,
469
- ' -B' , $newbindir , ' -s' , $newnode -> host,
470
- ' -p' , $oldnode -> port, ' -P' , $newnode -> port,
474
+ ' pg_upgrade' , ' --no-sync' ,
475
+ ' --old-datadir' => $oldnode -> data_dir,
476
+ ' --new-datadir' => $newnode -> data_dir,
477
+ ' --old-bindir' => $oldbindir ,
478
+ ' --new-bindir' => $newbindir ,
479
+ ' --socketdir' => $newnode -> host,
480
+ ' --old-port' => $oldnode -> port,
481
+ ' --new-port' => $newnode -> port,
471
482
$mode ,
472
483
],
473
484
' run of pg_upgrade for new instance' );
@@ -512,10 +523,11 @@ sub filter_dump
512
523
513
524
# Second dump from the upgraded instance.
514
525
@dump_command = (
515
- ' pg_dumpall' , ' --no-sync' , ' -d' , $newnode -> connstr(' postgres' ),
516
- ' -f' , $dump2_file );
526
+ ' pg_dumpall' , ' --no-sync' ,
527
+ ' --dbname' => $newnode -> connstr(' postgres' ),
528
+ ' --file' => $dump2_file );
517
529
# --extra-float-digits is needed when upgrading from a version older than 11.
518
- push (@dump_command , ' --extra-float-digits' , ' 0' )
530
+ push (@dump_command , ' --extra-float-digits' => ' 0' )
519
531
if ($oldnode -> pg_version < 12);
520
532
$newnode -> command_ok(\@dump_command , ' dump after running pg_upgrade' );
521
533
0 commit comments