]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Pre-beta mechanical code beautification, step 2: run pgperltidy.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 May 2026 14:37:42 +0000 (10:37 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 May 2026 14:37:42 +0000 (10:37 -0400)
It's as opinionated as ever.

48 files changed:
contrib/auto_explain/t/001_auto_explain.pl
contrib/pg_prewarm/t/001_basic.pl
contrib/pg_stash_advice/t/001_persist.pl
src/backend/storage/lmgr/generate-lwlocknames.pl
src/bin/pg_combinebackup/t/011_ib_truncation.pl
src/bin/pg_ctl/t/001_start_stop.pl
src/bin/pg_dump/t/001_basic.pl
src/bin/pg_dump/t/002_pg_dump.pl
src/bin/pg_dump/t/005_pg_dump_filterfile.pl
src/bin/pg_upgrade/t/003_logical_slots.pl
src/bin/pg_upgrade/t/004_subscription.pl
src/bin/pg_upgrade/t/006_transfer_modes.pl
src/bin/pg_verifybackup/t/007_wal.pl
src/bin/pg_verifybackup/t/008_untar.pl
src/bin/pg_verifybackup/t/010_client_untar.pl
src/bin/pg_waldump/t/001_basic.pl
src/bin/pgbench/t/001_pgbench_with_server.pl
src/bin/psql/t/001_basic.pl
src/bin/scripts/t/020_createdb.pl
src/bin/scripts/t/100_vacuumdb.pl
src/interfaces/libpq/t/006_service.pl
src/test/authentication/t/001_password.pl
src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl
src/test/modules/test_aio/t/002_io_workers.pl
src/test/modules/test_cloexec/t/001_cloexec.pl
src/test/modules/test_extensions/t/001_extension_control_path.pl
src/test/modules/test_misc/t/003_check_guc.pl
src/test/modules/test_misc/t/010_index_concurrently_upsert.pl
src/test/modules/test_misc/t/012_ddlutils.pl
src/test/modules/test_plan_advice/t/001_replan_regress.pl
src/test/modules/test_shmem/t/001_late_shmem_alloc.pl
src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
src/test/perl/PostgreSQL/Test/Cluster.pm
src/test/perl/PostgreSQL/Test/Utils.pm
src/test/postmaster/t/003_start_stop.pl
src/test/postmaster/t/004_negotiate.pl
src/test/recovery/t/013_crash_restart.pl
src/test/recovery/t/035_standby_logical_decoding.pl
src/test/recovery/t/040_standby_failover_slots_sync.pl
src/test/recovery/t/046_checkpoint_logical_slot.pl
src/test/recovery/t/051_effective_wal_level.pl
src/test/ssl/t/SSL/Server.pm
src/test/subscription/t/023_twophase_stream.pl
src/test/subscription/t/035_conflicts.pl
src/test/subscription/t/036_sequences.pl
src/tools/add_commit_links.pl

index b4e8e4b65a1dc9c21da4700028209d89b956dc56..f32a5e84f65be52cf9c0865f82bd45518e1bcaea 100644 (file)
@@ -173,9 +173,7 @@ like(
        "index scan logged, json mode");
 
 # Extension options.
-$log_contents = query_log(
-       $node,
-       "SELECT 1;",
+$log_contents = query_log($node, "SELECT 1;",
        { "auto_explain.log_extension_options" => "debug" });
 
 like(
index a11d1cbfd06f1f8004aa683512098083b922b600..71796111bb9ec3d8fd3d5def98c42583fb8f9e99 100644 (file)
@@ -45,28 +45,30 @@ ok( (        $stdout =~ qr/^[1-9][0-9]*$/
        'prefetch mode succeeded');
 
 # test_user should be unable to prewarm table/index without privileges
-($cmdret, $stdout, $stderr) =
-  $node->psql(
-    "postgres", "SELECT pg_prewarm('test');",
-    extra_params => [ '--username' => 'test_user' ]);
-ok($stderr =~ /permission denied for table test/, 'pg_prewarm failed as expected');
-($cmdret, $stdout, $stderr) =
-  $node->psql(
-    "postgres", "SELECT pg_prewarm('test_idx');",
-    extra_params => [ '--username' => 'test_user' ]);
-ok($stderr =~ /permission denied for index test_idx/, 'pg_prewarm failed as expected');
+($cmdret, $stdout, $stderr) = $node->psql(
+       "postgres",
+       "SELECT pg_prewarm('test');",
+       extra_params => [ '--username' => 'test_user' ]);
+ok($stderr =~ /permission denied for table test/,
+       'pg_prewarm failed as expected');
+($cmdret, $stdout, $stderr) = $node->psql(
+       "postgres",
+       "SELECT pg_prewarm('test_idx');",
+       extra_params => [ '--username' => 'test_user' ]);
+ok($stderr =~ /permission denied for index test_idx/,
+       'pg_prewarm failed as expected');
 
 # test_user should be able to prewarm table/index with privileges
 $node->safe_psql("postgres", "GRANT SELECT ON test TO test_user;");
-$result =
-  $node->safe_psql(
-    "postgres", "SELECT pg_prewarm('test');",
-    extra_params => [ '--username' => 'test_user' ]);
+$result = $node->safe_psql(
+       "postgres",
+       "SELECT pg_prewarm('test');",
+       extra_params => [ '--username' => 'test_user' ]);
 like($result, qr/^[1-9][0-9]*$/, 'pg_prewarm succeeded as expected');
-$result =
-  $node->safe_psql(
-    "postgres", "SELECT pg_prewarm('test_idx');",
-    extra_params => [ '--username' => 'test_user' ]);
+$result = $node->safe_psql(
+       "postgres",
+       "SELECT pg_prewarm('test_idx');",
+       extra_params => [ '--username' => 'test_user' ]);
 like($result, qr/^[1-9][0-9]*$/, 'pg_prewarm succeeded as expected');
 
 # test autoprewarm_dump_now()
index d146616660212137324681bae330a906ae3ae663..83e98889f93eaacf00d4bc61e7ca864d917e79df 100644 (file)
@@ -18,11 +18,11 @@ pg_stash_advice.persist = true
 pg_stash_advice.persist_interval = 0});
 $node->start;
 
-$node->safe_psql("postgres",
-               "CREATE EXTENSION pg_stash_advice;\n");
+$node->safe_psql("postgres", "CREATE EXTENSION pg_stash_advice;\n");
 
 # Create two stashes: one with 2 entries, one with 1 entry.
-$node->safe_psql("postgres", qq{
+$node->safe_psql(
+       "postgres", qq{
        SELECT pg_create_advice_stash('stash_a');
        SELECT pg_set_stashed_advice('stash_a', 1001, 'IndexScan(t)');
        SELECT pg_set_stashed_advice('stash_a', 1002, E'line1\\nline2\\ttab\\\\backslash');
@@ -32,7 +32,8 @@ $node->safe_psql("postgres", qq{
 
 # Verify before restart.
 my $result = $node->safe_psql("postgres",
-       "SELECT stash_name, num_entries FROM pg_get_advice_stashes() ORDER BY stash_name");
+       "SELECT stash_name, num_entries FROM pg_get_advice_stashes() ORDER BY stash_name"
+);
 is($result, "stash_a|2\nstash_b|1", 'stashes present before restart');
 
 # Restart and verify the data survived.
@@ -40,18 +41,21 @@ $node->restart;
 $node->wait_for_log("loaded 2 advice stashes and 3 entries");
 
 $result = $node->safe_psql("postgres",
-       "SELECT stash_name, num_entries FROM pg_get_advice_stashes() ORDER BY stash_name");
+       "SELECT stash_name, num_entries FROM pg_get_advice_stashes() ORDER BY stash_name"
+);
 is($result, "stash_a|2\nstash_b|1", 'stashes survived restart');
 
 # Verify entry contents, including the one with special characters.
 $result = $node->safe_psql("postgres",
-       "SELECT stash_name, query_id, advice_string FROM pg_get_advice_stash_contents(NULL) ORDER BY stash_name, query_id");
-is($result,
+       "SELECT stash_name, query_id, advice_string FROM pg_get_advice_stash_contents(NULL) ORDER BY stash_name, query_id"
+);
+is( $result,
        "stash_a|1001|IndexScan(t)\nstash_a|1002|line1\nline2\ttab\\backslash\nstash_b|2001|SeqScan(t)",
        'entry contents survived restart with special characters intact');
 
 # Add a third stash with 0 entries.
-$node->safe_psql("postgres", qq{
+$node->safe_psql(
+       "postgres", qq{
        SELECT pg_create_advice_stash('stash_c');
 });
 
@@ -60,11 +64,15 @@ $node->restart;
 $node->wait_for_log("loaded 3 advice stashes and 3 entries");
 
 $result = $node->safe_psql("postgres",
-       "SELECT stash_name, num_entries FROM pg_get_advice_stashes() ORDER BY stash_name");
-is($result, "stash_a|2\nstash_b|1\nstash_c|0", 'all three stashes survived second restart');
+       "SELECT stash_name, num_entries FROM pg_get_advice_stashes() ORDER BY stash_name"
+);
+is( $result,
+       "stash_a|2\nstash_b|1\nstash_c|0",
+       'all three stashes survived second restart');
 
 # Drop all stashes and verify the dump file is removed after restart.
-$node->safe_psql("postgres", qq{
+$node->safe_psql(
+       "postgres", qq{
        SELECT pg_drop_advice_stash('stash_a');
        SELECT pg_drop_advice_stash('stash_b');
        SELECT pg_drop_advice_stash('stash_c');
@@ -76,7 +84,7 @@ $result = $node->safe_psql("postgres",
        "SELECT count(*) FROM pg_get_advice_stashes()");
 is($result, "0", 'no stashes after dropping all and restarting');
 
-ok(!-f $node->data_dir . '/pg_stash_advice.tsv',
+ok( !-f $node->data_dir . '/pg_stash_advice.tsv',
        'dump file removed after all stashes dropped');
 
 $node->stop;
index b49007167b09644bfccb71daa12da1188967ffb1..48fa2807b2be4865f82d61f3ed4b7661eaeb075f 100644 (file)
@@ -160,8 +160,7 @@ while (<$lwlocklist>)
        die "unable to parse lwlocklist.h line \"$_\"";
 }
 
-die
-  "$wait_event_lwlocks[$lwlock_count] defined in wait_event_names.txt but "
+die "$wait_event_lwlocks[$lwlock_count] defined in wait_event_names.txt but "
   . " missing from lwlocklist.h"
   if $lwlock_count < scalar @wait_event_lwlocks;
 
index e1ce45215582cc51d592e6384541bde6c04dbf3a..117492864671dda020661956d326602335d5e83e 100644 (file)
@@ -76,7 +76,8 @@ $primary->safe_psql('postgres', 'VACUUM (TRUNCATE) t;');
 # Verify expected length after truncation.
 $t_blocks = $primary->safe_psql('postgres',
        "SELECT pg_relation_size('t') / current_setting('block_size')::int;");
-is($t_blocks, $rows_after_truncation, 'post-truncation row count as expected');
+is($t_blocks, $rows_after_truncation,
+       'post-truncation row count as expected');
 cmp_ok($t_blocks, '>', $target_blocks,
        'post-truncation block count as expected');
 
@@ -89,17 +90,17 @@ $primary->backup('incr',
 # truncation limit. We can't just check whether the restored VM fork is
 # the right size on disk, because it's so small that the incremental backup
 # code will send the entire file.
-my $relfilenode = $primary->safe_psql('postgres',
-       "SELECT pg_relation_filenode('t');");
-my $vm_limits = $primary->safe_psql('postgres',
+my $relfilenode =
+  $primary->safe_psql('postgres', "SELECT pg_relation_filenode('t');");
+my $vm_limits = $primary->safe_psql(
+       'postgres',
        "SELECT string_agg(relblocknumber::text, ',')
           FROM pg_available_wal_summaries() s,
                pg_wal_summary_contents(s.tli, s.start_lsn, s.end_lsn) c
          WHERE c.relfilenode = $relfilenode
            AND c.relforknumber = 2
            AND c.is_limit_block;");
-is($vm_limits, '1',
-       'WAL summary has correct VM fork truncation limit');
+is($vm_limits, '1', 'WAL summary has correct VM fork truncation limit');
 
 # Combine full and incremental backups.  Before the fix, this failed because
 # the INCREMENTAL file header contained an incorrect truncation_block_length
index 4a25b35ed9ca4ec2dd1fd45e602992b6ff4f66f5..a189b379f555b349e97935bc88647de6527d1a0f 100644 (file)
@@ -112,7 +112,12 @@ SKIP:
        ok(check_mode_recursive("$tempdir/data", 0750, 0640));
 }
 
-command_ok([ 'pg_ctl', 'restart', '--pgdata' => "$tempdir/data", '--log' => $logFileName ],
+command_ok(
+       [
+               'pg_ctl', 'restart',
+               '--pgdata' => "$tempdir/data",
+               '--log' => $logFileName
+       ],
        'pg_ctl restart with server running');
 
 system_or_bail 'pg_ctl', 'stop', '--pgdata' => "$tempdir/data";
index 509f4f9ce7dfc6e39397663f258a32698855c7f2..687e842cde987c92dc240905f7fc770ea6300ff2 100644 (file)
@@ -104,7 +104,8 @@ command_fails_like(
 command_fails_like(
        [ 'pg_dumpall', '-c', '-a' ],
        qr/\Qpg_dumpall: error: options -c\/--clean and -a\/--data-only cannot be used together\E/,
-       'pg_dumpall: options -c/--clean and -a/--data-only cannot be used together');
+       'pg_dumpall: options -c/--clean and -a/--data-only cannot be used together'
+);
 
 command_fails_like(
        [ 'pg_restore', '-c', '-a', '-f -' ],
index 3bc8e51561d3dbc6fd2e79617248c0a157102627..3ee9fda50e4cc8933ee0636aad5378b1f716d85c 100644 (file)
@@ -5279,7 +5279,7 @@ foreach my $run (sort keys %pgdump_runs)
                #
                # Either "all_runs" should be set or there should be a "like" list,
                # even if it is empty.  (This makes the test more self-documenting.)
-               if (!defined($tests{$test}->{all_runs})
+               if (   !defined($tests{$test}->{all_runs})
                        && !defined($tests{$test}->{like}))
                {
                        die "missing \"like\" in test \"$test\"";
index b2630ef289733bf9aea0f4e40b969af15b88214b..cecf0442088cfc395d664f5f612b14f86b66efd1 100644 (file)
@@ -460,8 +460,7 @@ command_fails_like(
                'postgres'
        ],
        qr/unsupported filter object type: "table-data"/,
-       "invalid syntax: invalid object type specified"
-);
+       "invalid syntax: invalid object type specified");
 
 # Test missing object identifier pattern
 open $inputfile, '>', "$tempdir/inputfile.txt"
index 15e6d267f2f11c9341ba189009d08c504823080d..de53c6f3eff98a848988c185619d3f7ed9713594 100644 (file)
@@ -152,10 +152,8 @@ like(
        slurp_file($slots_filename),
        qr/The slot \"test_slot2\" has not consumed the WAL yet/m,
        'the previous test failed due to unconsumed WALs');
-unlike(
-       slurp_file($slots_filename),
-       qr/test_slot3/m,
-       'caught-up slot is not reported');
+unlike(slurp_file($slots_filename),
+       qr/test_slot3/m, 'caught-up slot is not reported');
 
 
 # ------------------------------
index f68821df2a30e29e452fcadc515e8d2342898128..c94a82deae0649064b6278f104a9cb688a5631aa 100644 (file)
@@ -390,7 +390,8 @@ is($result, qq($remote_lsn), "remote_lsn should have been preserved");
 
 # The conflict detection slot should be created
 $result = $new_sub->safe_psql('postgres',
-       "SELECT xmin IS NOT NULL from pg_replication_slots WHERE slot_name = 'pg_conflict_detection'");
+       "SELECT xmin IS NOT NULL from pg_replication_slots WHERE slot_name = 'pg_conflict_detection'"
+);
 is($result, qq(t), "conflict detection slot exists");
 
 # Resume the initial sync and wait until all tables of subscription
index d317159bf128375a4a1778900afdf2cc4d36ed31..ca2d422bf283d58ba1ce2acffa0ee0cd7c0be515 100644 (file)
@@ -41,8 +41,10 @@ sub test_mode
        # allow_in_place_tablespaces is available as far back as v10.
        if ($old->pg_version >= 10)
        {
-               $new->append_conf('postgresql.conf', "allow_in_place_tablespaces = true");
-               $old->append_conf('postgresql.conf', "allow_in_place_tablespaces = true");
+               $new->append_conf('postgresql.conf',
+                       "allow_in_place_tablespaces = true");
+               $old->append_conf('postgresql.conf',
+                       "allow_in_place_tablespaces = true");
        }
 
        # We can only test security labels if both the old and new installations
@@ -95,13 +97,15 @@ sub test_mode
                $old->safe_psql('postgres',
                        "CREATE DATABASE testdb3 TABLESPACE inplc_tblspc");
                $old->safe_psql('postgres',
-                       "CREATE TABLE test5 TABLESPACE inplc_tblspc AS SELECT generate_series(503, 606)");
+                       "CREATE TABLE test5 TABLESPACE inplc_tblspc AS SELECT generate_series(503, 606)"
+               );
                $old->safe_psql('testdb3',
                        "CREATE TABLE test6 AS SELECT generate_series(607, 711)");
        }
 
        # While we are here, test handling of large objects.
-       $old->safe_psql('postgres', q|
+       $old->safe_psql(
+               'postgres', q|
                CREATE ROLE regress_lo_1;
                CREATE ROLE regress_lo_2;
 
@@ -115,7 +119,8 @@ sub test_mode
 
        if ($test_seclabel)
        {
-               $old->safe_psql('postgres', q|
+               $old->safe_psql(
+                       'postgres', q|
                        CREATE EXTENSION dummy_seclabel;
 
                        SELECT lo_from_bytea(4534, '\x00ffffff');
@@ -166,9 +171,11 @@ sub test_mode
                # Tests for in-place tablespaces.
                if ($old->pg_version >= 10)
                {
-                       $result = $new->safe_psql('postgres', "SELECT COUNT(*) FROM test5");
+                       $result =
+                         $new->safe_psql('postgres', "SELECT COUNT(*) FROM test5");
                        is($result, '104', "test5 data after pg_upgrade $mode");
-                       $result = $new->safe_psql('testdb3', "SELECT COUNT(*) FROM test6");
+                       $result =
+                         $new->safe_psql('testdb3', "SELECT COUNT(*) FROM test6");
                        is($result, '105', "test6 data after pg_upgrade $mode");
                }
 
@@ -182,18 +189,21 @@ sub test_mode
                $result = $new->safe_psql('postgres', "SELECT lo_get(4533)");
                is($result, '\x0f0f0f0f', "LO contents after upgrade");
                $result = $new->safe_psql('postgres',
-                       "SELECT lomowner::regrole FROM pg_largeobject_metadata WHERE oid = 4533");
+                       "SELECT lomowner::regrole FROM pg_largeobject_metadata WHERE oid = 4533"
+               );
                is($result, 'regress_lo_1', "LO owner after upgrade");
                $result = $new->safe_psql('postgres',
                        "SELECT lomacl FROM pg_largeobject_metadata WHERE oid = 4533");
-               is($result, '{regress_lo_1=rw/regress_lo_1,regress_lo_2=r/regress_lo_1}',
+               is( $result,
+                       '{regress_lo_1=rw/regress_lo_1,regress_lo_2=r/regress_lo_1}',
                        "LO ACL after upgrade");
 
                if ($test_seclabel)
                {
                        $result = $new->safe_psql('postgres', "SELECT lo_get(4534)");
                        is($result, '\x00ffffff', "LO contents after upgrade");
-                       $result = $new->safe_psql('postgres', q|
+                       $result = $new->safe_psql(
+                               'postgres', q|
                                SELECT label FROM pg_seclabel WHERE objoid = 4534
                                AND classoid = 'pg_largeobject'::regclass
                        |);
index 0e0377bfaccaa8e1f02914a78dc2a391af470155..12ca30139c544326dfdae285d1ab5f62a51cb007 100644 (file)
@@ -102,8 +102,7 @@ $primary->command_ok(
                '--checkpoint' => 'fast'
        ],
        "tar backup with separate pg_wal.tar");
-command_ok(
-       [ 'pg_verifybackup', $backup_path3 ],
+command_ok([ 'pg_verifybackup', $backup_path3 ],
        'WAL verification succeeds with separate pg_wal.tar');
 
 done_testing();
index 161c08c190d1f45e393141858a6308cbc21b48d6..21d152320c1c6f0021ad100d1cf5e89a233ce6d3 100644 (file)
@@ -121,9 +121,7 @@ for my $tc (@test_configuration)
 
                # Verify tar backup.
                $primary->command_ok(
-                       [
-                               'pg_verifybackup', '--exit-on-error', $backup_path,
-                       ],
+                       [ 'pg_verifybackup', '--exit-on-error', $backup_path, ],
                        "verify backup, compression $method");
 
                # Cleanup.
index 9670fbe4fda339fb19edf52d0f76d4976fa04a8d..db8b96ceb430f12ea8696136d57789072d50a153 100644 (file)
@@ -135,9 +135,7 @@ for my $tc (@test_configuration)
 
                # Verify tar backup.
                $primary->command_ok(
-                       [
-                               'pg_verifybackup', '--exit-on-error', $backup_path,
-                       ],
+                       [ 'pg_verifybackup', '--exit-on-error', $backup_path, ],
                        "verify backup, compression $method");
 
                # Cleanup.
index 7dd1c3dd63e7176e8dcd83c3207447ff755b1b8e..53b2f016b8035ece9e1043157ec982b06f5b1ab1 100644 (file)
@@ -198,8 +198,8 @@ END
 $$;
 });
 
-my $contrecord_lsn = $node->safe_psql('postgres',
-       'SELECT pg_current_wal_insert_lsn()');
+my $contrecord_lsn =
+  $node->safe_psql('postgres', 'SELECT pg_current_wal_insert_lsn()');
 # Generate contrecord record
 $node->safe_psql('postgres',
        qq{SELECT pg_logical_emit_message(true, 'test 026', repeat('xyzxz', 123456))}
@@ -243,8 +243,9 @@ command_like(
        'runs with start and end segment specified');
 command_like(
        [
-               'pg_waldump', '--quiet', '--path',
-               $node->data_dir . '/pg_wal/', $start_walfile
+               'pg_waldump', '--quiet',
+               '--path', $node->data_dir . '/pg_wal/',
+               $start_walfile
        ],
        qr/^$/,
        'no output with --quiet option');
@@ -336,7 +337,8 @@ sub generate_archive
 
        my @files;
        opendir my $dh, $directory or die "opendir: $!";
-       while (my $entry = readdir $dh) {
+       while (my $entry = readdir $dh)
+       {
                # Skip '.' and '..'
                next if $entry eq '.' || $entry eq '..';
                push @files, $entry;
@@ -379,20 +381,23 @@ for my $scenario (@scenarios)
 {
        my $path = $scenario->{'path'};
 
-       SKIP:
+  SKIP:
        {
                skip "tar command is not available", 56
                  if (!defined $tar || $tar eq '') && $scenario->{'is_archive'};
-               skip "$scenario->{'compression_method'} compression not supported by this build", 56
+               skip
+                 "$scenario->{'compression_method'} compression not supported by this build",
+                 56
                  if !$scenario->{'enabled'} && $scenario->{'is_archive'};
 
-                 # create pg_wal archive
-                 if ($scenario->{'is_archive'})
-                 {
-                         generate_archive($path,
-                                 $node->data_dir . '/pg_wal',
-                                 $scenario->{'compression_flags'});
-                 }
+               # create pg_wal archive
+               if ($scenario->{'is_archive'})
+               {
+                       generate_archive(
+                               $path,
+                               $node->data_dir . '/pg_wal',
+                               $scenario->{'compression_flags'});
+               }
 
                command_fails_like(
                        [ 'pg_waldump', '--path' => $path ],
@@ -445,22 +450,28 @@ for my $scenario (@scenarios)
                like($lines[0], qr/WAL statistics/, "statistics on stdout");
                is(grep(/^rmgr:/, @lines), 0, 'no rmgr lines output');
 
-               @lines = test_pg_waldump($path, $start_lsn, $end_lsn, '--stats=record');
+               @lines =
+                 test_pg_waldump($path, $start_lsn, $end_lsn, '--stats=record');
                like($lines[0], qr/WAL statistics/, "statistics on stdout");
                is(grep(/^rmgr:/, @lines), 0, 'no rmgr lines output');
 
-               @lines = test_pg_waldump($path, $start_lsn, $end_lsn, '--rmgr' => 'Btree');
+               @lines =
+                 test_pg_waldump($path, $start_lsn, $end_lsn, '--rmgr' => 'Btree');
                is(grep(!/^rmgr: Btree/, @lines), 0, 'only Btree lines');
 
-               @lines = test_pg_waldump($path, $start_lsn, $end_lsn, '--fork' => 'init');
+               @lines =
+                 test_pg_waldump($path, $start_lsn, $end_lsn, '--fork' => 'init');
                is(grep(!/fork init/, @lines), 0, 'only init fork lines');
 
                @lines = test_pg_waldump($path, $start_lsn, $end_lsn,
                        '--relation' => "$default_ts_oid/$postgres_db_oid/$rel_t1_oid");
-               is(grep(!/rel $default_ts_oid\/$postgres_db_oid\/$rel_t1_oid/, @lines),
-                       0, 'only lines for selected relation');
+               is( grep(!/rel $default_ts_oid\/$postgres_db_oid\/$rel_t1_oid/,
+                               @lines),
+                       0,
+                       'only lines for selected relation');
 
-               @lines = test_pg_waldump($path, $start_lsn, $end_lsn,
+               @lines = test_pg_waldump(
+                       $path, $start_lsn, $end_lsn,
                        '--relation' => "$default_ts_oid/$postgres_db_oid/$rel_i1a_oid",
                        '--block' => 1);
                is(grep(!/\bblk 1\b/, @lines), 0, 'only lines for selected block');
index b7685ea5d20fce2dae6f38e5d847a3c024158810..bb12ade59f5087ee4b6d0a36c998faf316ef0c51 100644 (file)
@@ -1823,10 +1823,9 @@ update counter set i = i+1 returning i \gset
 
 # Test copy in pgbench
 $node->pgbench(
-       '-t 10',
-       2,
+       '-t 10', 2,
        [],
-       [ qr{COPY is not supported in pgbench, aborting} ],
+       [qr{COPY is not supported in pgbench, aborting}],
        'Test copy in script',
        {
                '001_copy' => q{ COPY pgbench_accounts FROM stdin }
@@ -1836,16 +1835,12 @@ $node->pgbench(
 $node->safe_psql('postgres', 'DROP TABLE counter;');
 
 # Test --continue-on-error
-$node->safe_psql('postgres',
-       'CREATE TABLE unique_table(i int unique);');
+$node->safe_psql('postgres', 'CREATE TABLE unique_table(i int unique);');
 
 $node->pgbench(
        '-n -t 10 --continue-on-error --failures-detailed',
        0,
-       [
-               qr{processed: 1/10\b},
-               qr{other failures: 9\b}
-       ],
+       [ qr{processed: 1/10\b}, qr{other failures: 9\b} ],
        [],
        'test --continue-on-error',
        {
index cd4a21ca6391a54e518cdb7233741f759bd1e9ee..3961e69e1cc7f112d56f4eaab76cd00368d06b76 100644 (file)
@@ -142,7 +142,9 @@ my ($ret, $out, $err) = $node->psql('postgres',
 is($ret, 2, 'server crash: psql exit code');
 like($out, qr/before/, 'server crash: output before crash');
 unlike($out, qr/AFTER/, 'server crash: no output after crash');
-like( $err, qr/psql:<stdin>:2: FATAL:  terminating connection due to administrator command
+like(
+       $err,
+       qr/psql:<stdin>:2: FATAL:  terminating connection due to administrator command
 psql:<stdin>:2: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
index a0995868363c438fe4158a209e2dc67f83275fc4..4a8845990b646269eafed49c21b5ae4b8897c9f0 100644 (file)
@@ -242,16 +242,14 @@ $node->command_fails(
        'fails for invalid locale provider');
 
 $node->command_fails_like(
-    [ 'createdb', "invalid \n dbname" ],
-    qr(contains a newline or carriage return character),
-    'fails if database name contains a newline character in name'
-);
+       [ 'createdb', "invalid \n dbname" ],
+       qr(contains a newline or carriage return character),
+       'fails if database name contains a newline character in name');
 
 $node->command_fails_like(
-    [ 'createdb', "invalid \r dbname" ],
-    qr(contains a newline or carriage return character),
-    'fails if database name contains a carriage return character in name'
-);
+       [ 'createdb', "invalid \r dbname" ],
+       qr(contains a newline or carriage return character),
+       'fails if database name contains a carriage return character in name');
 
 # Check use of templates with shared dependencies copied from the template.
 my ($ret, $stdout, $stderr) = $node->psql(
index cf0b853e9bfab6510ce573a749cb49e323239b2d..84fcacd57fad0038a84ce9f62b328fe3636e4b05 100644 (file)
@@ -241,15 +241,17 @@ $node->command_fails_like(
        qr/cannot vacuum all databases and a specific one at the same time/,
        'cannot use option --all and a dbname as argument at the same time');
 
-$node->safe_psql('postgres', q|
+$node->safe_psql(
+       'postgres', q|
   CREATE TABLE regression_vacuumdb_test AS select generate_series(1, 10) a, generate_series(2, 11) b;
   ALTER TABLE regression_vacuumdb_test ADD COLUMN c INT GENERATED ALWAYS AS (a + b);
 |);
 $node->issues_sql_unlike(
        [
-               'vacuumdb', '--analyze-only', '--dry-run',
-               '--missing-stats-only', '-t',
-               'regression_vacuumdb_test', 'postgres'
+               'vacuumdb', '--analyze-only',
+               '--dry-run', '--missing-stats-only',
+               '-t', 'regression_vacuumdb_test',
+               'postgres'
        ],
        qr/statement:\ ANALYZE/sx,
        '--missing-stats-only --dry-run');
@@ -354,19 +356,15 @@ $node->issues_sql_unlike(
        '--missing-stats-only with no missing partition stats');
 
 $node->safe_psql('postgres',
-       "CREATE TABLE parent_table (a INT) PARTITION BY LIST (a);\n"
+               "CREATE TABLE parent_table (a INT) PARTITION BY LIST (a);\n"
          . "CREATE TABLE child_table PARTITION OF parent_table FOR VALUES IN (1);\n"
          . "INSERT INTO parent_table VALUES (1);\n");
 $node->issues_sql_like(
-       [
-               'vacuumdb', '--analyze-only', 'postgres'
-       ],
+       [ 'vacuumdb', '--analyze-only', 'postgres' ],
        qr/statement: ANALYZE public.parent_table/s,
        '--analyze-only updates statistics for partitioned tables');
 $node->issues_sql_unlike(
-       [
-               'vacuumdb', '--analyze-only', 'postgres'
-       ],
+       [ 'vacuumdb', '--analyze-only', 'postgres' ],
        qr/statement:\ VACUUM/sx,
        '--analyze-only does not run vacuum');
 
index 9e92e7b0203ac41587231c2c94b3acc9dc67080b..7462d21314db20f9664c384a1b42a2289977fff8 100644 (file)
@@ -53,8 +53,7 @@ append_to_file($srvfile_nested, "service=invalid_srv\n");
 my $srvfile_nested_2 = "$td/pg_service_nested_2.conf";
 copy($srvfile_valid, $srvfile_nested_2)
   or die "Could not copy $srvfile_valid to $srvfile_nested_2: $!";
-append_to_file($srvfile_nested_2,
-       'servicefile=' . $srvfile_default . "\n");
+append_to_file($srvfile_nested_2, 'servicefile=' . $srvfile_default . "\n");
 
 # Set the fallback directory lookup of the service file to the temporary
 # directory of this test.  PGSYSCONFDIR is used if the service file
index a4b11673c26e42624ecaad0a617d09c3a92c769c..69ed4919b16e8996a7a93d2faa2d4610fec65112 100644 (file)
@@ -68,23 +68,24 @@ $node->init;
 $node->append_conf('postgresql.conf', "log_connections = on\n");
 # Needed to allow connect_fails to inspect postmaster log:
 $node->append_conf('postgresql.conf', "log_min_messages = debug2");
-$node->append_conf('postgresql.conf', "password_expiration_warning_threshold = '1100d'");
+$node->append_conf('postgresql.conf',
+       "password_expiration_warning_threshold = '1100d'");
 $node->start;
 
 # Set up roles for password_expiration_warning_threshold test
 my $current_year = 1900 + ${ [ localtime(time) ] }[5];
 my $expire_year = $current_year - 1;
-$node->safe_psql(
-       'postgres',
-       "CREATE ROLE expired LOGIN VALID UNTIL '$expire_year-01-01' PASSWORD 'pass'");
+$node->safe_psql('postgres',
+       "CREATE ROLE expired LOGIN VALID UNTIL '$expire_year-01-01' PASSWORD 'pass'"
+);
 $expire_year = $current_year + 2;
-$node->safe_psql(
-       'postgres',
-       "CREATE ROLE expiration_warnings LOGIN VALID UNTIL '$expire_year-01-01' PASSWORD 'pass'");
+$node->safe_psql('postgres',
+       "CREATE ROLE expiration_warnings LOGIN VALID UNTIL '$expire_year-01-01' PASSWORD 'pass'"
+);
 $expire_year = $current_year + 5;
-$node->safe_psql(
-       'postgres',
-       "CREATE ROLE no_warnings LOGIN VALID UNTIL '$expire_year-01-01' PASSWORD 'pass'");
+$node->safe_psql('postgres',
+       "CREATE ROLE no_warnings LOGIN VALID UNTIL '$expire_year-01-01' PASSWORD 'pass'"
+);
 
 # Test behavior of log_connections GUC
 #
@@ -498,9 +499,9 @@ test_conn($node, 'user=scram_role', 'md5', 0,
 SKIP:
 {
        skip "MD5 not supported" unless $md5_works;
-       test_conn($node, 'user=md5_role', 'md5', 0,
-               expected_stderr =>
-                 qr/authenticated with an MD5-encrypted password/,
+       test_conn(
+               $node, 'user=md5_role', 'md5', 0,
+               expected_stderr => qr/authenticated with an MD5-encrypted password/,
                log_like =>
                  [qr/connection authenticated: identity="md5_role" method=md5/]);
 }
@@ -553,19 +554,13 @@ $node->connect_fails(
 $node->connect_fails(
        "user=expired dbname=postgres",
        "connection fails due to expired password",
-       expected_stderr =>
-         qr/password authentication failed for user "expired"/
-);
+       expected_stderr => qr/password authentication failed for user "expired"/);
 $node->connect_ok(
        "user=expiration_warnings dbname=postgres",
        "connection succeeds with password expiration warning",
-       expected_stderr =>
-         qr/role password will expire soon/
-);
-$node->connect_ok(
-       "user=no_warnings dbname=postgres",
-       "connection succeeds with no password expiration warning"
-);
+       expected_stderr => qr/role password will expire soon/);
+$node->connect_ok("user=no_warnings dbname=postgres",
+       "connection succeeds with no password expiration warning");
 
 # Test SYSTEM_USER <> NULL with parallel workers.
 $node->safe_psql(
index f2c72581f947841b73337c9018b6315a50d5fd24..c74fda8aa37188840417f90ed4dadb2288562146 100644 (file)
@@ -52,8 +52,7 @@ for my $testname (@tests)
        # Execute the test using the latest protocol version.
        $node->command_ok(
                [
-                       'libpq_pipeline', @extraargs,
-                       $testname,
+                       'libpq_pipeline', @extraargs, $testname,
                        $node->connstr('postgres') . " max_protocol_version=latest"
                ],
                "libpq_pipeline $testname");
index d8b07d4cf7b55066cdbf89256a176d2c5841beb2..3a08bc77195fb83b2854634a45b42dc6f70f690b 100644 (file)
@@ -106,7 +106,8 @@ example.com "$ddir/server.crt" "$ddir/server.key" "" "echo FooBaR1" on
                qr/WARNING.*SNI is enabled; installed TLS init hook will be ignored/,
                "server warns that init hook and SNI are incompatible");
        # Ensure that the warning was printed once and not once per host line
-       my $count =()= $log_contents =~ m/installed TLS init hook will be ignored/;
+       my $count = () =
+         $log_contents =~ m/installed TLS init hook will be ignored/;
        is($count, 1, 'Only one WARNING');
 }
 
index b9775811d4ddb625a8b755a14fcfb70a34009147..7950cb0c1db84eed31a702d4198225fa0a64d66e 100644 (file)
@@ -34,7 +34,8 @@ sub test_number_of_io_workers_dynamic
 {
        my $node = shift;
 
-       my $prev_worker_count = $node->safe_psql('postgres', 'SHOW io_min_workers');
+       my $prev_worker_count =
+         $node->safe_psql('postgres', 'SHOW io_min_workers');
 
        # Verify that worker count can't be set to 0
        change_number_of_io_workers($node, 0, $prev_worker_count, 1);
@@ -65,7 +66,8 @@ sub change_number_of_io_workers
        my ($result, $stdout, $stderr);
 
        ($result, $stdout, $stderr) =
-         $node->psql('postgres', "ALTER SYSTEM SET io_min_workers = $worker_count");
+         $node->psql('postgres',
+               "ALTER SYSTEM SET io_min_workers = $worker_count");
        $node->safe_psql('postgres', 'SELECT pg_reload_conf()');
 
        if ($expect_failure)
@@ -73,8 +75,7 @@ sub change_number_of_io_workers
                like(
                        $stderr,
                        qr/$worker_count is outside the valid range for parameter "io_min_workers"/,
-                       "updating io_min_workers to $worker_count failed, as expected"
-               );
+                       "updating io_min_workers to $worker_count failed, as expected");
 
                return $prev_worker_count;
        }
index 5cea63d982b10df2cbf344dc9dacbff9d9dbf61c..4c80b8d825d0f9ec76eeba1579a800edcd459883 100644 (file)
@@ -43,7 +43,7 @@ if (!-f $test_prog)
 note("Using test program: $test_prog");
 
 my ($stdout, $stderr);
-my $result = run [ $test_prog ], '>', \$stdout, '2>', \$stderr;
+my $result = run [$test_prog], '>', \$stdout, '2>', \$stderr;
 
 note("Test program output:");
 note($stdout) if $stdout;
@@ -55,6 +55,6 @@ if ($stderr)
 }
 
 ok($result && $stdout =~ /SUCCESS.*O_CLOEXEC behavior verified/s,
-   "O_CLOEXEC prevents handle inheritance");
+       "O_CLOEXEC prevents handle inheritance");
 
 done_testing();
index f8302503b4bfa92bb24bff5ea28c87edee918225..c1cec0dc622fdfaaf8f613d1023350f37e4714e8 100644 (file)
@@ -46,7 +46,8 @@ $node->safe_psql('postgres', "CREATE USER $user");
 
 my $ecp = $node->safe_psql('postgres', 'show extension_control_path;');
 
-is($ecp, "\$system$sep$ext_dir$sep$ext_dir2",
+is( $ecp,
+       "\$system$sep$ext_dir$sep$ext_dir2",
        "custom extension control directory path configured");
 
 $node->safe_psql('postgres', "CREATE EXTENSION $ext_name");
@@ -79,21 +80,25 @@ is( $ret,
 
 # Test that a non-superuser is not able to read the extension location in
 # pg_available_extensions
-$ret = $node->safe_psql('postgres',
+$ret = $node->safe_psql(
+       'postgres',
        "select location from pg_available_extensions where name = '$ext_name2'",
        connstr => "user=$user");
 is( $ret,
        "<insufficient privilege>",
-       "extension location is hidden in pg_available_extensions for users with insufficient privilege");
+       "extension location is hidden in pg_available_extensions for users with insufficient privilege"
+);
 
 # Test that a non-superuser is not able to read the extension location in
 # pg_available_extension_versions
-$ret = $node->safe_psql('postgres',
+$ret = $node->safe_psql(
+       'postgres',
        "select location from pg_available_extension_versions where name = '$ext_name2'",
        connstr => "user=$user");
 is( $ret,
        "<insufficient privilege>",
-       "extension location is hidden in pg_available_extension_versions for users with insufficient privilege");
+       "extension location is hidden in pg_available_extension_versions for users with insufficient privilege"
+);
 
 # Ensure that extensions installed in $system are still visible when used with
 # custom extension control path.
index be96b5174de8dd0f92123d2e93558b7d33d66880..8b9ef1919802dfcb480ed84830b98d0b4dac930e 100644 (file)
@@ -105,7 +105,8 @@ my @sample_intersect = grep($not_in_sample_hash{$_}, @gucs_in_file);
 is(scalar(@sample_intersect),
        0, "no parameters marked as NOT_IN_SAMPLE in postgresql.conf.sample");
 
-is(scalar(@lines_with_tabs), 0, "no lines with tabs in postgresql.conf.sample");
+is(scalar(@lines_with_tabs),
+       0, "no lines with tabs in postgresql.conf.sample");
 
 # These would log some information only on errors.
 foreach my $param (@missing_from_file)
index 3bdb632887e55df392c54dc97d6a74c1fda28c84..50a0e7db8f734eb4ccfbc538ab65a15a6a18f016 100644 (file)
@@ -603,7 +603,9 @@ clean_safe_quit_ok($s1, $s2, $s3);
 $node->safe_psql('postgres', 'TRUNCATE TABLE test.tblparted');
 
 ############################################################################
-note('Test: REINDEX on partitioned table, cache inval between two get_partition_ancestors');
+note(
+       'Test: REINDEX on partitioned table, cache inval between two get_partition_ancestors'
+);
 
 $s1 = $node->background_psql('postgres', on_error_stop => 0);
 $s2 = $node->background_psql('postgres', on_error_stop => 0);
index a0e21c69fb59d78f308827cf5f662ef4dd2ae356..bcdb831a6761ac0dede846ef5436991a2328fd5a 100644 (file)
@@ -42,12 +42,14 @@ sub ddl_filter
 $node->safe_psql('postgres', 'CREATE ROLE regress_role_ddl_test1');
 my $result = $node->safe_psql('postgres',
        q{SELECT * FROM pg_get_role_ddl('regress_role_ddl_test1')});
-like($result,
+like(
+       $result,
        qr/CREATE ROLE regress_role_ddl_test1 .* NOLOGIN/,
        'basic role DDL');
 
 # Role with multiple privileges
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        CREATE ROLE regress_role_ddl_test2
          LOGIN SUPERUSER CREATEDB CREATEROLE
          CONNECTION LIMIT 5
@@ -60,7 +62,8 @@ like($result, qr/CONNECTION LIMIT 5/, 'role with CONNECTION LIMIT');
 like($result, qr/VALID UNTIL '2030-12-31/, 'role with VALID UNTIL');
 
 # Role with configuration parameters
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        ALTER ROLE regress_role_ddl_test1 SET work_mem TO '256MB';
        ALTER ROLE regress_role_ddl_test1 SET search_path TO myschema, public});
 $result = $node->safe_psql('postgres',
@@ -69,14 +72,16 @@ like($result, qr/SET work_mem TO '256MB'/, 'role with work_mem setting');
 like($result, qr/SET search_path TO/, 'role with search_path setting');
 
 # Role with database-specific configuration (needs a real database)
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        CREATE DATABASE regression_ddlutils_test
          TEMPLATE template0 ENCODING 'UTF8' LC_COLLATE 'C' LC_CTYPE 'C';
        ALTER ROLE regress_role_ddl_test2
          IN DATABASE regression_ddlutils_test SET work_mem TO '128MB'});
 $result = $node->safe_psql('postgres',
        q{SELECT * FROM pg_get_role_ddl('regress_role_ddl_test2')});
-like($result,
+like(
+       $result,
        qr/IN DATABASE regression_ddlutils_test SET work_mem TO '128MB'/,
        'role with database-specific setting');
 
@@ -84,16 +89,17 @@ like($result,
 $node->safe_psql('postgres', q{CREATE ROLE "regress_role-with-dash"});
 $result = $node->safe_psql('postgres',
        q{SELECT * FROM pg_get_role_ddl('regress_role-with-dash')});
-like($result, qr/"regress_role-with-dash"/,
-       'role name requiring quoting');
+like($result, qr/"regress_role-with-dash"/, 'role name requiring quoting');
 
 # Pretty-printed output
 $result = $node->safe_psql('postgres',
-       q{SELECT * FROM pg_get_role_ddl('regress_role_ddl_test2', 'pretty', 'true')});
+       q{SELECT * FROM pg_get_role_ddl('regress_role_ddl_test2', 'pretty', 'true')}
+);
 like($result, qr/\n\s+SUPERUSER/, 'role pretty-print indents attributes');
 
 # Role with memberships
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        CREATE ROLE regress_role_ddl_grantor CREATEROLE;
        CREATE ROLE regress_role_ddl_group1;
        CREATE ROLE regress_role_ddl_group2;
@@ -108,36 +114,42 @@ $node->safe_psql('postgres', q{
        RESET ROLE});
 $result = $node->safe_psql('postgres',
        q{SELECT * FROM pg_get_role_ddl('regress_role_ddl_member')});
-like($result, qr/GRANT regress_role_ddl_group1 TO regress_role_ddl_member/,
+like(
+       $result,
+       qr/GRANT regress_role_ddl_group1 TO regress_role_ddl_member/,
        'role with memberships includes GRANT');
 like($result, qr/SET FALSE/, 'membership includes SET FALSE');
 like($result, qr/ADMIN TRUE/, 'membership includes ADMIN TRUE');
 
 # Memberships suppressed
 $result = $node->safe_psql('postgres',
-       q{SELECT * FROM pg_get_role_ddl('regress_role_ddl_member', 'memberships', 'false')});
+       q{SELECT * FROM pg_get_role_ddl('regress_role_ddl_member', 'memberships', 'false')}
+);
 unlike($result, qr/GRANT/, 'memberships suppressed');
 
 # Non-existent role (should error)
-my ($ret, $stdout, $stderr) = $node->psql('postgres',
-       q{SELECT * FROM pg_get_role_ddl(9999999::oid)});
+my ($ret, $stdout, $stderr) =
+  $node->psql('postgres', q{SELECT * FROM pg_get_role_ddl(9999999::oid)});
 isnt($ret, 0, 'non-existent role errors');
 like($stderr, qr/does not exist/, 'non-existent role error message');
 
 # NULL input (should return no rows)
-$result = $node->safe_psql('postgres',
-       q{SELECT count(*) FROM pg_get_role_ddl(NULL)});
+$result =
+  $node->safe_psql('postgres', q{SELECT count(*) FROM pg_get_role_ddl(NULL)});
 is($result, '0', 'NULL role returns no rows');
 
 # Permission check: revoke SELECT on pg_authid
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        CREATE ROLE regress_role_ddl_noaccess;
        REVOKE SELECT ON pg_authid FROM PUBLIC});
-($ret, $stdout, $stderr) = $node->psql('postgres',
+($ret, $stdout, $stderr) = $node->psql(
+       'postgres',
        q{SET ROLE regress_role_ddl_noaccess;
          SELECT * FROM pg_get_role_ddl('regress_role_ddl_test1')});
 isnt($ret, 0, 'role DDL denied without pg_authid access');
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        GRANT SELECT ON pg_authid TO PUBLIC});
 
 
@@ -146,7 +158,8 @@ $node->safe_psql('postgres', q{
 ########################################################################
 
 # Set up: the test database was already created above for role tests.
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        ALTER DATABASE regression_ddlutils_test OWNER TO regress_role_ddl_test2;
        ALTER DATABASE regression_ddlutils_test CONNECTION LIMIT 123;
        ALTER DATABASE regression_ddlutils_test SET random_page_cost = 2.0;
@@ -165,44 +178,60 @@ is($result, '0', 'NULL database returns no rows');
 
 # Invalid option
 ($ret, $stdout, $stderr) = $node->psql('postgres',
-       q{SELECT * FROM pg_get_database_ddl('regression_ddlutils_test', 'owner', 'invalid')});
+       q{SELECT * FROM pg_get_database_ddl('regression_ddlutils_test', 'owner', 'invalid')}
+);
 isnt($ret, 0, 'invalid boolean option errors');
 like($stderr, qr/invalid value/, 'invalid option error message');
 
 # Duplicate option
-($ret, $stdout, $stderr) = $node->psql('postgres',
+($ret, $stdout, $stderr) = $node->psql(
+       'postgres',
        q{SELECT * FROM pg_get_database_ddl('regression_ddlutils_test',
          'owner', 'false', 'owner', 'true')});
 isnt($ret, 0, 'duplicate option errors');
 
 # Basic output (without locale details)
-$result = ddl_filter($node->safe_psql('postgres',
-       q{SELECT pg_get_database_ddl
+$result = ddl_filter(
+       $node->safe_psql(
+               'postgres',
+               q{SELECT pg_get_database_ddl
          FROM pg_get_database_ddl('regression_ddlutils_test')}));
-like($result, qr/CREATE DATABASE regression_ddlutils_test/,
+like(
+       $result,
+       qr/CREATE DATABASE regression_ddlutils_test/,
        'database DDL includes CREATE');
 like($result, qr/TEMPLATE = template0/, 'database DDL includes TEMPLATE');
 like($result, qr/ENCODING = 'UTF8'/, 'database DDL includes ENCODING');
-like($result, qr/OWNER TO regress_role_ddl_test2/, 'database DDL includes OWNER');
+like(
+       $result,
+       qr/OWNER TO regress_role_ddl_test2/,
+       'database DDL includes OWNER');
 like($result, qr/CONNECTION LIMIT = 123/, 'database DDL includes CONNLIMIT');
-like($result, qr/SET random_page_cost TO '2.0'/,
+like(
+       $result,
+       qr/SET random_page_cost TO '2.0'/,
        'database DDL includes GUC setting');
 
 # Pretty-printed output
-$result = ddl_filter($node->safe_psql('postgres',
-       q{SELECT pg_get_database_ddl
+$result = ddl_filter(
+       $node->safe_psql(
+               'postgres',
+               q{SELECT pg_get_database_ddl
          FROM pg_get_database_ddl('regression_ddlutils_test',
            'pretty', 'true', 'tablespace', 'false')}));
 like($result, qr/\n\s+WITH TEMPLATE/, 'database DDL pretty-prints WITH');
 
 # Permission check
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        REVOKE CONNECT ON DATABASE regression_ddlutils_test FROM PUBLIC});
-($ret, $stdout, $stderr) = $node->psql('postgres',
+($ret, $stdout, $stderr) = $node->psql(
+       'postgres',
        q{SET ROLE regress_role_ddl_noaccess;
          SELECT * FROM pg_get_database_ddl('regression_ddlutils_test')});
 isnt($ret, 0, 'database DDL denied without CONNECT');
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        GRANT CONNECT ON DATABASE regression_ddlutils_test TO PUBLIC});
 
 
@@ -216,8 +245,8 @@ $node->safe_psql('postgres', q{
 isnt($ret, 0, 'non-existent tablespace errors');
 
 # Non-existent tablespace by OID
-($ret, $stdout, $stderr) = $node->psql('postgres',
-       q{SELECT * FROM pg_get_tablespace_ddl(0::oid)});
+($ret, $stdout, $stderr) =
+  $node->psql('postgres', q{SELECT * FROM pg_get_tablespace_ddl(0::oid)});
 isnt($ret, 0, 'non-existent tablespace OID errors');
 
 # NULL input (name and OID variants)
@@ -229,7 +258,8 @@ $result = $node->safe_psql('postgres',
 is($result, '0', 'NULL tablespace OID returns no rows');
 
 # Tablespace name requiring quoting
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        SET allow_in_place_tablespaces = true;
        CREATE TABLESPACE "regress_ tblsp" OWNER regress_role_ddl_test1
          LOCATION ''});
@@ -238,7 +268,8 @@ $result = $node->safe_psql('postgres',
 like($result, qr/"regress_ tblsp"/, 'tablespace name is quoted');
 
 # Rename and add options; reuse this tablespace for the remaining tests
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        ALTER TABLESPACE "regress_ tblsp" RENAME TO regress_allopt_tblsp;
        ALTER TABLESPACE regress_allopt_tblsp
          SET (seq_page_cost = '1.5', random_page_cost = '1.1234567890',
@@ -247,41 +278,51 @@ $node->safe_psql('postgres', q{
 # Tablespace with multiple options
 $result = $node->safe_psql('postgres',
        q{SELECT * FROM pg_get_tablespace_ddl('regress_allopt_tblsp')});
-like($result, qr/CREATE TABLESPACE regress_allopt_tblsp/,
+like(
+       $result,
+       qr/CREATE TABLESPACE regress_allopt_tblsp/,
        'tablespace DDL includes CREATE');
-like($result, qr/OWNER regress_role_ddl_test1/,
+like(
+       $result,
+       qr/OWNER regress_role_ddl_test1/,
        'tablespace DDL includes OWNER');
 like($result, qr/seq_page_cost='1.5'/, 'tablespace DDL includes options');
 
 # Pretty-printed output
-$result = $node->safe_psql('postgres',
+$result = $node->safe_psql(
+       'postgres',
        q{SELECT * FROM pg_get_tablespace_ddl('regress_allopt_tblsp',
          'pretty', 'true')});
 like($result, qr/\n\s+OWNER/, 'tablespace DDL pretty-prints OWNER');
 
 # Owner suppressed
-$result = $node->safe_psql('postgres',
+$result = $node->safe_psql(
+       'postgres',
        q{SELECT * FROM pg_get_tablespace_ddl('regress_allopt_tblsp',
          'owner', 'false')});
 unlike($result, qr/OWNER/, 'tablespace DDL owner suppressed');
 
 # Lookup by OID
-$result = $node->safe_psql('postgres', q{
+$result = $node->safe_psql(
+       'postgres', q{
        SELECT pg_get_tablespace_ddl
        FROM pg_get_tablespace_ddl(
          (SELECT oid FROM pg_tablespace
           WHERE spcname = 'regress_allopt_tblsp'))});
-like($result, qr/CREATE TABLESPACE regress_allopt_tblsp/,
+like(
+       $result,
+       qr/CREATE TABLESPACE regress_allopt_tblsp/,
        'tablespace DDL by OID');
 
 # Permission check
-$node->safe_psql('postgres',
-       q{REVOKE SELECT ON pg_tablespace FROM PUBLIC});
-($ret, $stdout, $stderr) = $node->psql('postgres',
+$node->safe_psql('postgres', q{REVOKE SELECT ON pg_tablespace FROM PUBLIC});
+($ret, $stdout, $stderr) = $node->psql(
+       'postgres',
        q{SET ROLE regress_role_ddl_noaccess;
          SELECT * FROM pg_get_tablespace_ddl('regress_allopt_tblsp')});
 isnt($ret, 0, 'tablespace DDL denied without pg_tablespace access');
-$node->safe_psql('postgres', q{
+$node->safe_psql(
+       'postgres', q{
        GRANT SELECT ON pg_tablespace TO PUBLIC});
 
 $node->stop;
index 452b179a665f75c6a11b25ab3183e61d3283d391..13ef3543830bcf5e6df774bae4f22f5dd2705377 100644 (file)
@@ -41,8 +41,10 @@ my $rc =
   system($ENV{PG_REGRESS} . " "
          . "--bindir= "
          . "--dlpath=\"$dlpath\" "
-         . "--host=" . $node->host . " "
-         . "--port=" . $node->port . " "
+         . "--host="
+         . $node->host . " "
+         . "--port="
+         . $node->port . " "
          . "--schedule=$srcdir/src/test/regress/parallel_schedule "
          . "--max-concurrent-tests=20 "
          . "--inputdir=\"$inputdir\" "
index c154f57682ac4cdf81272a6d1aacf63968793ac1..5cf07d071ec39c4e88155f8e49e8edb500b15d72 100644 (file)
@@ -19,30 +19,41 @@ $node->start;
 $node->safe_psql("postgres", "CREATE EXTENSION test_shmem;");
 
 # Check that the attach counter is incremented on a new connection
-my $attach_count1 = $node->safe_psql("postgres", "SELECT get_test_shmem_attach_count();");
-my $attach_count2 = $node->safe_psql("postgres", "SELECT get_test_shmem_attach_count();");
-cmp_ok($attach_count2, '>', $attach_count1, "attach callback is called in each backend");
+my $attach_count1 =
+  $node->safe_psql("postgres", "SELECT get_test_shmem_attach_count();");
+my $attach_count2 =
+  $node->safe_psql("postgres", "SELECT get_test_shmem_attach_count();");
+cmp_ok($attach_count2, '>', $attach_count1,
+       "attach callback is called in each backend");
 $node->stop;
 
 ###
 # Test that loading via shared_preload_libraries also works
 ###
-$node->append_conf('postgresql.conf', "shared_preload_libraries = 'test_shmem'");
+$node->append_conf('postgresql.conf',
+       "shared_preload_libraries = 'test_shmem'");
 $node->start;
 
 # When loaded via shared_preload_libraries, the attach callback is
 # called or not, depending on whether this is an EXEC_BACKEND build.
-my $exec_backend = $node->safe_psql("postgres", "SHOW debug_exec_backend;") eq 'on';
-$attach_count1 = $node->safe_psql("postgres", "SELECT get_test_shmem_attach_count();");
-$attach_count2 = $node->safe_psql("postgres", "SELECT get_test_shmem_attach_count();");
+my $exec_backend =
+  $node->safe_psql("postgres", "SHOW debug_exec_backend;") eq 'on';
+$attach_count1 =
+  $node->safe_psql("postgres", "SELECT get_test_shmem_attach_count();");
+$attach_count2 =
+  $node->safe_psql("postgres", "SELECT get_test_shmem_attach_count();");
 
 if ($exec_backend)
 {
-   cmp_ok($attach_count2, '>', $attach_count1, "attach callback is called in each backend when loaded via shared_preload_libraries");
+       cmp_ok($attach_count2, '>', $attach_count1,
+               "attach callback is called in each backend when loaded via shared_preload_libraries"
+       );
 }
 else
 {
-   ok($attach_count1 == 0 && $attach_count2 == 0, "attach callback is not called when loaded via shared_preload_libraries");
+       ok( $attach_count1 == 0 && $attach_count2 == 0,
+               "attach callback is not called when loaded via shared_preload_libraries"
+       );
 }
 
 $node->stop;
index 5cc7a0b50ae79aef206b389b17b8ab571cdd3601..8a0c6c98a39af6136a20206a4716f5dac576c335 100644 (file)
@@ -117,11 +117,17 @@ sub adjust_database_contents
        {
                if ($dbnames{"contrib_regression_btree_gist"})
                {
-                       _add_st($result, 'contrib_regression_btree_gist',
+                       _add_st(
+                               $result,
+                               'contrib_regression_btree_gist',
                                "drop index if exists public.inettmp_a_a1_idx");
-                       _add_st($result, 'contrib_regression_btree_gist',
+                       _add_st(
+                               $result,
+                               'contrib_regression_btree_gist',
                                "drop index if exists public.inetidx");
-                       _add_st($result, 'contrib_regression_btree_gist',
+                       _add_st(
+                               $result,
+                               'contrib_regression_btree_gist',
                                "drop index public.cidridx");
                }
                if ($dbnames{"regression_btree_gist"})
index c6ff2dbde4cacfddf3b1124f1cb7f36c0b1becfc..d7797225451d429d4bd65e2cff08c74b6bf83f6d 100644 (file)
@@ -246,7 +246,8 @@ sub query
 
        local $Test::Builder::Level = $Test::Builder::Level + 1;
 
-       note "issuing query $query_cnt via background psql: $query" unless !$params{verbose};
+       note "issuing query $query_cnt via background psql: $query"
+         unless !$params{verbose};
 
        $self->{timeout}->start() if (defined($self->{query_timer_restart}));
 
@@ -280,7 +281,8 @@ sub query
          explain {
                stdout => $self->{stdout},
                stderr => $self->{stderr},
-         } unless !$params{verbose};
+         }
+         unless !$params{verbose};
 
        die "psql query timed out" if $self->{timeout}->is_expired;
 
index bdc051e6ead5173c834ed362f22d8f8ab4da37f1..4fcb1f6be56d61d0ec5061bc2b66b89e5612e9ed 100644 (file)
@@ -1352,9 +1352,9 @@ sub restart
                my $log =
                  PostgreSQL::Test::Utils::slurp_file($self->logfile, $log_location);
                unlike($log, $params{log_unlike}, "unexpected fragment found in log")
-                       if defined $params{log_unlike};
+                 if defined $params{log_unlike};
                like($log, $params{log_like}, "expected fragment not found in log")
-                       if defined $params{log_like};
+                 if defined $params{log_like};
        }
 
        if ($ret != 0)
@@ -2270,7 +2270,7 @@ sub psql
                my $exc_save = $@;
 
                # we need a dummy $stderr from hereon, if we didn't collect it
-               if (! defined $stderr)
+               if (!defined $stderr)
                {
                        my $errtxt = "<not collected>";
                        $stderr = \$errtxt;
@@ -3960,7 +3960,8 @@ sub validate_slot_inactive_since
                ),
                't',
                "last inactive time for slot $slot_name is valid on node $name")
-         or croak "could not validate captured inactive_since for slot $slot_name";
+         or croak
+         "could not validate captured inactive_since for slot $slot_name";
 
        return $inactive_since;
 }
index 81dbcab8257c9f6e3ab316480201409627063984..d3e6abf7a68cf262c73ad430975470e24dccb70c 100644 (file)
@@ -968,7 +968,7 @@ sub _diag_command_output
 
        diag(join(" ", @$cmd));
 
-       for my $channel (['stdout', $stdout], ['stderr', $stderr])
+       for my $channel ([ 'stdout', $stdout ], [ 'stderr', $stderr ])
        {
                my ($name, $output) = @$channel;
                next unless $output;
@@ -977,9 +977,9 @@ sub _diag_command_output
                my @lines = split /\n/, $output;
                if (@lines > 60)
                {
-                       diag(join("\n", @lines[0 .. 29]));
+                       diag(join("\n", @lines[ 0 .. 29 ]));
                        diag("... " . (@lines - 60) . " lines omitted ...");
-                       diag(join("\n", @lines[-30 .. -1]));
+                       diag(join("\n", @lines[ -30 .. -1 ]));
                }
                else
                {
index e384518c4746709ed2c3c070fb704b2300d62f33..24a75362c0ef0681d7ebaa83d4319d6d421abe1c 100644 (file)
@@ -85,7 +85,8 @@ for (my $i = 0; $i <= 20; $i++)
 # before even looking up the user. Hence you now get "sorry, too many
 # clients already" instead of "role does not exist" error. Test that
 # to ensure that we have used up all the slots.
-$node->connect_fails("dbname=postgres user=invalid_user",
+$node->connect_fails(
+       "dbname=postgres user=invalid_user",
        "connection is rejected when all slots are in use",
        expected_stderr => qr/FATAL:  sorry, too many clients already/);
 
index 949aa2ba19ac085ebcf7d0acf17712a75e2fdd7e..6765d94740475426e424d55069f3032d57b107aa 100644 (file)
@@ -39,8 +39,7 @@ $sock->recv($reply, 1);
 if ($reply ne 'N')
 {
        $sock->close();
-       plan skip_all =>
-         "server accepted SSL; test requires SSL to be rejected";
+       plan skip_all => "server accepted SSL; test requires SSL to be rejected";
 }
 
 # Send GSSENCRequest, reject or bypass test.
@@ -50,8 +49,7 @@ $sock->recv($reply, 1);
 if ($reply ne 'N')
 {
        $sock->close();
-       plan skip_all =>
-         "server accepted GSS; test requires GSS to be rejected";
+       plan skip_all => "server accepted GSS; test requires GSS to be rejected";
 }
 
 my $log_offset = -s $node->logfile;
@@ -71,7 +69,7 @@ isnt($reply, 'N',
 
 $sock->close();
 $node->wait_for_log(qr/FATAL: .* unsupported frontend protocol 1234.5679/,
-                                       $log_offset);
+       $log_offset);
 
 # Check extra connection with a simple query.
 my $result = $node->safe_psql('postgres', 'select 1;');
index 56afb1aa6ebb5ced6105d2c4a3472eabe54b01aa..0fde920713e53c1f52e87d4edc15a370803c1309 100644 (file)
@@ -255,8 +255,10 @@ is( $node->safe_psql(
 
 # Confirm that the logical replication launcher, a background worker
 # without the never-restart flag, has also restarted successfully.
-is($node->poll_query_until('postgres',
-       "SELECT count(*) = 1 FROM pg_stat_activity WHERE backend_type = 'logical replication launcher'"),
+is( $node->poll_query_until(
+               'postgres',
+               "SELECT count(*) = 1 FROM pg_stat_activity WHERE backend_type = 'logical replication launcher'"
+       ),
        '1',
        'logical replication launcher restarted after crash');
 
index d264a698ff63179b1e4ea5534a312c404603457f..4421059f100eccdf600fef057becc2d17123f6ec 100644 (file)
@@ -758,12 +758,14 @@ wait_until_vacuum_can_remove(
 
 # message should not be issued
 ok( !$node_standby->log_contains(
-               "invalidating obsolete replication slot \"no_conflict_inactiveslot\"", $logstart),
+               "invalidating obsolete replication slot \"no_conflict_inactiveslot\"",
+               $logstart),
        'inactiveslot slot invalidation is not logged with vacuum on conflict_test'
 );
 
 ok( !$node_standby->log_contains(
-               "invalidating obsolete replication slot \"no_conflict_activeslot\"", $logstart),
+               "invalidating obsolete replication slot \"no_conflict_activeslot\"",
+               $logstart),
        'activeslot slot invalidation is not logged with vacuum on conflict_test'
 );
 
index 47d64d05ad1a87b334f512e3d6dec456915acdfd..f8922aaa1a2ca5601173559216903e218c493da0 100644 (file)
@@ -1031,9 +1031,11 @@ $primary->wait_for_replay_catchup($standby2);
 ##################################################
 
 # Recreate the slot by creating a subscription on the subscriber, keep it disabled.
-$subscriber1->safe_psql('postgres', qq[
+$subscriber1->safe_psql(
+       'postgres', qq[
        CREATE TABLE push_wal (a int);
-       CREATE SUBSCRIPTION regress_mysub1 CONNECTION '$publisher_connstr' PUBLICATION regress_mypub WITH (slot_name = lsub1_slot, failover = true, enabled = false);]);
+       CREATE SUBSCRIPTION regress_mysub1 CONNECTION '$publisher_connstr' PUBLICATION regress_mypub WITH (slot_name = lsub1_slot, failover = true, enabled = false);]
+);
 
 # Create some DDL on the primary so that the slot lags behind the standby
 $primary->safe_psql('postgres', "CREATE TABLE push_wal (a int);");
@@ -1059,7 +1061,8 @@ $standby2->reload;
 # further calls, call the API in a background process.
 my $h = $standby2->background_psql('postgres', on_error_stop => 0);
 
-$h->query_until(qr/start/, q(
+$h->query_until(
+       qr/start/, q(
        \echo start
        SELECT pg_sync_replication_slots();
        ));
@@ -1089,7 +1092,8 @@ synchronized_standby_slots = 'sb2_slot'
 $primary->reload;
 
 # Enable the Subscription, so that the remote slot catches up
-$subscriber1->safe_psql('postgres', "ALTER SUBSCRIPTION regress_mysub1 ENABLE");
+$subscriber1->safe_psql('postgres',
+       "ALTER SUBSCRIPTION regress_mysub1 ENABLE");
 $subscriber1->wait_for_subscription_sync;
 
 # Create xl_running_xacts on the primary to speed up restart_lsn advancement.
@@ -1097,8 +1101,8 @@ $primary->safe_psql('postgres', "SELECT pg_log_standby_snapshot();");
 
 # Confirm from the log that the slot is sync-ready now.
 $standby2->wait_for_log(
-    qr/newly created replication slot \"lsub1_slot\" is sync-ready now/,
-    $log_offset);
+       qr/newly created replication slot \"lsub1_slot\" is sync-ready now/,
+       $log_offset);
 
 $h->quit;
 
index 1ecb47a8b58170b0228400c07f61ae37338357a1..66761bf56c1531c746e4f130bd69d3cd02bed614 100644 (file)
@@ -158,9 +158,7 @@ $primary->backup($backup_name);
 
 # Create a standby
 my $standby = PostgreSQL::Test::Cluster->new('standby');
-$standby->init_from_backup(
-       $primary, $backup_name,
-       has_streaming => 1);
+$standby->init_from_backup($primary, $backup_name, has_streaming => 1);
 
 my $connstr_1 = $primary->connstr;
 $standby->append_conf(
@@ -170,7 +168,8 @@ primary_slot_name = 'phys_slot'
 primary_conninfo = '$connstr_1 dbname=postgres'
 ));
 
-$primary->safe_psql('postgres',
+$primary->safe_psql(
+       'postgres',
        q{SELECT pg_create_logical_replication_slot('failover_slot', 'test_decoding', false, false, true);
         SELECT pg_create_physical_replication_slot('phys_slot');}
 );
@@ -198,7 +197,8 @@ checkpoint;
 
 # Wait until the checkpoint stops right before invalidating slots
 note('waiting for injection_point');
-$standby->wait_for_event('checkpointer', 'restartpoint-before-slot-invalidation');
+$standby->wait_for_event('checkpointer',
+       'restartpoint-before-slot-invalidation');
 note('injection_point is reached');
 
 # Enable slot sync worker to synchronize the failover slot to the standby
@@ -206,12 +206,13 @@ $standby->append_conf('postgresql.conf', qq(sync_replication_slots = on));
 $standby->reload;
 
 # Wait for the slot to be synced
-$standby->poll_query_until(
-       'postgres',
-       "SELECT COUNT(*) > 0 FROM pg_replication_slots WHERE slot_name = 'failover_slot'");
+$standby->poll_query_until('postgres',
+       "SELECT COUNT(*) > 0 FROM pg_replication_slots WHERE slot_name = 'failover_slot'"
+);
 
 # Release the checkpointer
-$standby->safe_psql('postgres',
+$standby->safe_psql(
+       'postgres',
        q{select injection_points_wakeup('restartpoint-before-slot-invalidation');
          select injection_points_detach('restartpoint-before-slot-invalidation')});
 
index 991473726a94c77d57ba18e337d0a52735a97d75..c4c2662f72b4b267535fb21570c91722a37e945a 100644 (file)
@@ -100,7 +100,8 @@ command_fails(
                '--log' => $primary->logfile,
                'start',
        ],
-       "cannot start server with wal_level='minimal' as there is in-use logical slot");
+       "cannot start server with wal_level='minimal' as there is in-use logical slot"
+);
 
 my $logfile = slurp_file($primary->logfile());
 like(
index 4c101a265038bd770d3fa0103f7e5e173a8c8282..4400a432f421774992d90a2375d799e6904d7799 100644 (file)
@@ -323,8 +323,7 @@ sub switch_server_cert
        $node->append_conf('sslconfig.conf', 'ssl=on');
        $node->append_conf('sslconfig.conf', $backend->set_server_cert(\%params));
        # use lists of ECDH curves and cipher suites for syntax testing
-       $node->append_conf('sslconfig.conf',
-               'ssl_groups=prime256v1:secp521r1');
+       $node->append_conf('sslconfig.conf', 'ssl_groups=prime256v1:secp521r1');
        $node->append_conf('sslconfig.conf',
                'ssl_tls13_ciphers=TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256');
 
index 8bf93aa379b6acb0bc330ecbaebe983fc1c30518..e9e0f753f7c802912f5dc1f6b096f0960815291e 100644 (file)
@@ -451,16 +451,14 @@ $offset = -s $node_subscriber->logfile;
 
 # Confirm the ERROR is reported because max_prepared_transactions is zero
 $node_subscriber->wait_for_log(
-       qr/ERROR: ( [A-Z0-9]+:)? prepared transactions are disabled/,
-       $offset);
+       qr/ERROR: ( [A-Z0-9]+:)? prepared transactions are disabled/, $offset);
 
 # Confirm that the parallel apply worker has encountered an error. The check
 # focuses on the worker type as a keyword, since the error message content may
 # differ based on whether the leader initially detected the parallel apply
 # worker's failure or received a signal from it.
 $node_subscriber->wait_for_log(
-       qr/ERROR: .*logical replication parallel apply worker.*/,
-       $offset);
+       qr/ERROR: .*logical replication parallel apply worker.*/, $offset);
 
 # Set max_prepared_transactions to correct value to resume the replication
 $node_subscriber->append_conf('postgresql.conf',
index 426ad74cf33aaaedd9bf1fd0ab9f52f254562318..f23fe6af2a5e4797a06fbcfe76b09cdc7dc41109 100644 (file)
@@ -281,7 +281,7 @@ $node_A->safe_psql('postgres', "INSERT INTO tab VALUES (1, 1), (2, 2);");
 $node_A->wait_for_catchup($subname_BA);
 
 my $result = $node_B->safe_psql('postgres', "SELECT * FROM tab;");
-is($result, qq(1|1
+is( $result, qq(1|1
 2|2), 'check replicated insert on node B');
 
 # Disable the logical replication from node B to node A
@@ -297,9 +297,8 @@ my $log_location = -s $node_B->logfile;
 $node_B->safe_psql('postgres', "UPDATE tab SET b = 3 WHERE a = 1;");
 $node_A->safe_psql('postgres', "DELETE FROM tab WHERE a = 1;");
 
-($cmdret, $stdout, $stderr) = $node_A->psql(
-       'postgres', qq(VACUUM (verbose) public.tab;)
-);
+($cmdret, $stdout, $stderr) =
+  $node_A->psql('postgres', qq(VACUUM (verbose) public.tab;));
 
 like(
        $stderr,
@@ -319,8 +318,7 @@ like(
 
 $log_location = -s $node_A->logfile;
 
-$node_A->safe_psql(
-       'postgres', "ALTER SUBSCRIPTION $subname_AB ENABLE;");
+$node_A->safe_psql('postgres', "ALTER SUBSCRIPTION $subname_AB ENABLE;");
 $node_B->wait_for_catchup($subname_AB);
 
 $logfile = slurp_file($node_A->logfile(), $log_location);
@@ -367,8 +365,7 @@ $node_A->safe_psql('postgres', "DELETE FROM tab WHERE a = 2;");
 
 $log_location = -s $node_A->logfile;
 
-$node_A->safe_psql(
-       'postgres', "ALTER SUBSCRIPTION $subname_AB ENABLE;");
+$node_A->safe_psql('postgres', "ALTER SUBSCRIPTION $subname_AB ENABLE;");
 $node_B->wait_for_catchup($subname_AB);
 
 $logfile = slurp_file($node_A->logfile(), $log_location);
@@ -406,7 +403,8 @@ ok( $node_A->poll_query_until(
 $node_B->safe_psql('postgres', "ALTER PUBLICATION tap_pub_B ADD TABLE tab");
 
 $node_A->safe_psql('postgres',
-       "ALTER SUBSCRIPTION $subname_AB REFRESH PUBLICATION WITH (copy_data = false)");
+       "ALTER SUBSCRIPTION $subname_AB REFRESH PUBLICATION WITH (copy_data = false)"
+);
 
 ###############################################################################
 # Test that publisher's transactions marked with DELAY_CHKPT_IN_COMMIT prevent
@@ -422,7 +420,8 @@ my $injection_points_supported = $node_B->check_extension('injection_points');
 # commit after marking DELAY_CHKPT_IN_COMMIT flag.
 if ($injection_points_supported != 0)
 {
-       $node_B->append_conf('postgresql.conf',
+       $node_B->append_conf(
+               'postgresql.conf',
                "shared_preload_libraries = 'injection_points'
                max_prepared_transactions = 1");
        $node_B->restart;
@@ -469,11 +468,11 @@ if ($injection_points_supported != 0)
        );
 
        # Wait until the backend enters the injection point
-       $node_B->wait_for_event('client backend', 'commit-after-delay-checkpoint');
+       $node_B->wait_for_event('client backend',
+               'commit-after-delay-checkpoint');
 
        # Confirm the update is suspended
-       $result =
-         $node_B->safe_psql('postgres', 'SELECT * FROM tab WHERE a = 1');
+       $result = $node_B->safe_psql('postgres', 'SELECT * FROM tab WHERE a = 1');
        is($result, qq(1|1), 'publisher sees the old row');
 
        # Delete the row on the subscriber. The deleted row should be retained due to a
@@ -490,14 +489,12 @@ if ($injection_points_supported != 0)
        # Confirm that the apply worker keeps requesting publisher status, while
        # awaiting the prepared transaction to commit. Thus, the request log should
        # appear more than once.
-       $node_A->wait_for_log(
-               qr/sending publisher status request message/,
+       $node_A->wait_for_log(qr/sending publisher status request message/,
                $log_location);
 
        $log_location = -s $node_A->logfile;
 
-       $node_A->wait_for_log(
-               qr/sending publisher status request message/,
+       $node_A->wait_for_log(qr/sending publisher status request message/,
                $log_location);
 
        # Confirm that the dead tuple cannot be removed
@@ -523,8 +520,7 @@ if ($injection_points_supported != 0)
        ok($pub_session->quit, "close publisher session");
 
        # Confirm that the transaction committed
-       $result =
-         $node_B->safe_psql('postgres', 'SELECT * FROM tab WHERE a = 1');
+       $result = $node_B->safe_psql('postgres', 'SELECT * FROM tab WHERE a = 1');
        is($result, qq(1|2), 'publisher sees the new row');
 
        # Ensure the UPDATE is replayed on subscriber
@@ -539,8 +535,7 @@ if ($injection_points_supported != 0)
                'update target row was deleted in tab');
 
        # Remember the next transaction ID to be assigned
-       $next_xid =
-         $node_A->safe_psql('postgres', "SELECT txid_current() + 1;");
+       $next_xid = $node_A->safe_psql('postgres', "SELECT txid_current() + 1;");
 
        # Confirm that the xmin value is advanced to the latest nextXid after the
        # prepared transaction on the publisher has been committed.
@@ -583,7 +578,8 @@ $node_B->reload;
 
 # Enable failover to activate the synchronized_standby_slots setting
 $node_A->safe_psql('postgres', "ALTER SUBSCRIPTION $subname_AB DISABLE;");
-$node_A->safe_psql('postgres', "ALTER SUBSCRIPTION $subname_AB SET (failover = true);");
+$node_A->safe_psql('postgres',
+       "ALTER SUBSCRIPTION $subname_AB SET (failover = true);");
 $node_A->safe_psql('postgres', "ALTER SUBSCRIPTION $subname_AB ENABLE;");
 
 # Insert a record
@@ -611,7 +607,8 @@ ok( $node_A->poll_query_until(
        "the xmin value of slot 'pg_conflict_detection' is invalid on Node A");
 
 $result = $node_A->safe_psql('postgres',
-       "SELECT subretentionactive FROM pg_subscription WHERE subname='$subname_AB';");
+       "SELECT subretentionactive FROM pg_subscription WHERE subname='$subname_AB';"
+);
 is($result, qq(f), 'retention is inactive');
 
 ###############################################################################
@@ -648,7 +645,8 @@ ok( $node_A->poll_query_until(
        "the xmin value of slot 'pg_conflict_detection' is valid on Node A");
 
 $result = $node_A->safe_psql('postgres',
-       "SELECT subretentionactive FROM pg_subscription WHERE subname='$subname_AB';");
+       "SELECT subretentionactive FROM pg_subscription WHERE subname='$subname_AB';"
+);
 is($result, qq(t), 'retention is active');
 
 ###############################################################################
@@ -656,8 +654,7 @@ is($result, qq(t), 'retention is active');
 # removing all the subscriptions.
 ###############################################################################
 
-$node_B->safe_psql(
-       'postgres', "DROP SUBSCRIPTION $subname_BA");
+$node_B->safe_psql('postgres', "DROP SUBSCRIPTION $subname_BA");
 
 ok( $node_B->poll_query_until(
                'postgres',
@@ -665,8 +662,7 @@ ok( $node_B->poll_query_until(
        ),
        "the slot 'pg_conflict_detection' has been dropped on Node B");
 
-$node_A->safe_psql(
-       'postgres', "DROP SUBSCRIPTION $subname_AB");
+$node_A->safe_psql('postgres', "DROP SUBSCRIPTION $subname_AB");
 
 ok( $node_A->poll_query_until(
                'postgres',
index 387b057268df36d290e8712d15743c4c99755c14..8e293871efb2c7de696b279918b278a6de5c19ca 100644 (file)
@@ -250,15 +250,12 @@ my $publisher_limited_connstr =
   $node_publisher->connstr . ' dbname=postgres user=regress_seq_repl';
 $log_offset = -s $node_subscriber->logfile;
 
-$node_subscriber->safe_psql(
-       'postgres',
+$node_subscriber->safe_psql('postgres',
        "ALTER SUBSCRIPTION regress_seq_sub CONNECTION '$publisher_limited_connstr'"
 );
 
-$node_subscriber->safe_psql(
-       'postgres',
-       "ALTER SUBSCRIPTION regress_seq_sub REFRESH SEQUENCES"
-);
+$node_subscriber->safe_psql('postgres',
+       "ALTER SUBSCRIPTION regress_seq_sub REFRESH SEQUENCES");
 
 $node_subscriber->wait_for_log(
        qr/WARNING: ( [A-Z0-9]+:)? missing sequence on publisher \("public.regress_s2"\)/,
index d9e657f00546ebd50fff20337f75db5079b0a5af..3db95a233616743d9f61f3662056ce1091aeb46e 100755 (executable)
@@ -51,7 +51,7 @@ sub process_file
        $file =~ m/-(\d+)\./;
        my $major_version = $1;
        die "file name $file is not in the expected format\n"
-               unless defined $major_version;
+         unless defined $major_version;
 
        open(my $fh, '<', $file) || die "could not open file $file: $!\n";
        open(my $tfh, '>', $tmpfile) || die "could not open file $tmpfile: $!\n";