The pgperltidy diffs in HEAD

Started by Daniel Gustafssonabout 2 months ago18 messages
#1Daniel Gustafsson
daniel@yesql.se
1 attachment(s)

I routinely run pgperltidy src/ when hacking on things, and am greeted with
lots of diffs like how pgindent runs used to be. Are there objections to
applying the diffs we've accumulated so far with a .git-blame-ignore-revs
update alongside it? Are there reasons not that I am missing?

Attached is the current output from pgperltidy, I haven't looked over it in
detail but I am happy to take that on assuming it's not objected to.

--
Daniel Gustafsson

Attachments:

pgperltidy_20251125.diffapplication/octet-stream; name=pgperltidy_20251125.diff; x-unix-mode=0644Download
diff --git a/src/backend/storage/lmgr/generate-lwlocknames.pl b/src/backend/storage/lmgr/generate-lwlocknames.pl
index cd3e43c448a..cb50387e6dc 100644
--- a/src/backend/storage/lmgr/generate-lwlocknames.pl
+++ b/src/backend/storage/lmgr/generate-lwlocknames.pl
@@ -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;
 
diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl
index 445a541abf6..88432ef6e48 100644
--- a/src/bin/pg_dump/t/002_pg_dump.pl
+++ b/src/bin/pg_dump/t/002_pg_dump.pl
@@ -5157,7 +5157,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\"";
diff --git a/src/bin/pg_dump/t/005_pg_dump_filterfile.pl b/src/bin/pg_dump/t/005_pg_dump_filterfile.pl
index bd848a84b2e..f8df357e5aa 100644
--- a/src/bin/pg_dump/t/005_pg_dump_filterfile.pl
+++ b/src/bin/pg_dump/t/005_pg_dump_filterfile.pl
@@ -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"
diff --git a/src/bin/pg_upgrade/t/004_subscription.pl b/src/bin/pg_upgrade/t/004_subscription.pl
index 77387be0f9d..83a5cdb88bd 100644
--- a/src/bin/pg_upgrade/t/004_subscription.pl
+++ b/src/bin/pg_upgrade/t/004_subscription.pl
@@ -384,7 +384,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
diff --git a/src/bin/pg_upgrade/t/006_transfer_modes.pl b/src/bin/pg_upgrade/t/006_transfer_modes.pl
index 2f68f0b56aa..a532e2b5332 100644
--- a/src/bin/pg_upgrade/t/006_transfer_modes.pl
+++ b/src/bin/pg_upgrade/t/006_transfer_modes.pl
@@ -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
 			|);
diff --git a/src/bin/pgbench/t/001_pgbench_with_server.pl b/src/bin/pgbench/t/001_pgbench_with_server.pl
index 581e9af7907..c38228de9f6 100644
--- a/src/bin/pgbench/t/001_pgbench_with_server.pl
+++ b/src/bin/pgbench/t/001_pgbench_with_server.pl
@@ -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',
 	{
diff --git a/src/bin/scripts/t/100_vacuumdb.pl b/src/bin/scripts/t/100_vacuumdb.pl
index a16fad593f7..2ecbbc7a425 100644
--- a/src/bin/scripts/t/100_vacuumdb.pl
+++ b/src/bin/scripts/t/100_vacuumdb.pl
@@ -237,7 +237,8 @@ $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);
 |);
@@ -342,19 +343,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');
 
diff --git a/src/interfaces/libpq/t/006_service.pl b/src/interfaces/libpq/t/006_service.pl
index 29a70629b44..0128ba2179d 100644
--- a/src/interfaces/libpq/t/006_service.pl
+++ b/src/interfaces/libpq/t/006_service.pl
@@ -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
diff --git a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
index f9678853070..e2202747f6c 100644
--- a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
+++ b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
@@ -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");
diff --git a/src/test/modules/test_extensions/t/001_extension_control_path.pl b/src/test/modules/test_extensions/t/001_extension_control_path.pl
index 7fbe5bde332..6070086722f 100644
--- a/src/test/modules/test_extensions/t/001_extension_control_path.pl
+++ b/src/test/modules/test_extensions/t/001_extension_control_path.pl
@@ -37,7 +37,8 @@ $node->start;
 
 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");
diff --git a/src/test/modules/test_misc/t/003_check_guc.pl b/src/test/modules/test_misc/t/003_check_guc.pl
index 6872b1abde9..1394f650212 100644
--- a/src/test/modules/test_misc/t/003_check_guc.pl
+++ b/src/test/modules/test_misc/t/003_check_guc.pl
@@ -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)
diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index 35413f14019..8dd86a21875 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -1870,8 +1870,8 @@ sub get_free_port
 		{
 			foreach my $addr (qw(127.0.0.1),
 				($use_tcp && $PostgreSQL::Test::Utils::windows_os)
-				  ? qw(127.0.0.2 127.0.0.3 0.0.0.0)
-				  : ())
+				? qw(127.0.0.2 127.0.0.3 0.0.0.0)
+				: ())
 			{
 				if (!can_bind($addr, $port))
 				{
@@ -2228,7 +2228,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;
@@ -3880,8 +3880,7 @@ sub advance_wal
 
 ##########################################################################
 
-package PostgreSQL::Test::Cluster::V_11
-  ;    ## no critic (ProhibitMultiplePackages)
+package PostgreSQL::Test::Cluster::V_11;    ## no critic (ProhibitMultiplePackages)
 
 use parent -norequire, qw(PostgreSQL::Test::Cluster);
 
@@ -3908,8 +3907,7 @@ sub init
 
 ##########################################################################
 
-package PostgreSQL::Test::Cluster::V_10
-  ;    ## no critic (ProhibitMultiplePackages)
+package PostgreSQL::Test::Cluster::V_10;    ## no critic (ProhibitMultiplePackages)
 
 use parent -norequire, qw(PostgreSQL::Test::Cluster::V_11);
 
diff --git a/src/test/recovery/t/013_crash_restart.pl b/src/test/recovery/t/013_crash_restart.pl
index 4c5af018ee4..51ff4dac399 100644
--- a/src/test/recovery/t/013_crash_restart.pl
+++ b/src/test/recovery/t/013_crash_restart.pl
@@ -230,8 +230,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');
 
diff --git a/src/test/recovery/t/035_standby_logical_decoding.pl b/src/test/recovery/t/035_standby_logical_decoding.pl
index ebe2fae1789..49cdc26eade 100644
--- a/src/test/recovery/t/035_standby_logical_decoding.pl
+++ b/src/test/recovery/t/035_standby_logical_decoding.pl
@@ -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'
 );
 
diff --git a/src/test/subscription/t/035_conflicts.pl b/src/test/subscription/t/035_conflicts.pl
index a94bde16f53..b00e9f6ff6e 100644
--- a/src/test/subscription/t/035_conflicts.pl
+++ b/src/test/subscription/t/035_conflicts.pl
@@ -286,7 +286,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
@@ -302,9 +302,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,
@@ -325,8 +324,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);
@@ -373,8 +371,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);
@@ -412,7 +409,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
@@ -428,7 +426,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;
@@ -475,11 +474,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
@@ -496,14 +495,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
@@ -529,8 +526,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
@@ -545,8 +541,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.
@@ -589,7 +584,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
@@ -617,7 +613,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');
 
 ###############################################################################
@@ -654,7 +651,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');
 
 ###############################################################################
@@ -662,8 +660,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',
@@ -671,8 +668,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',
diff --git a/src/tools/add_commit_links.pl b/src/tools/add_commit_links.pl
index 87a6e47e6fe..2c1094f7e27 100755
--- a/src/tools/add_commit_links.pl
+++ b/src/tools/add_commit_links.pl
@@ -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";
#2Álvaro Herrera
alvherre@kurilemu.de
In reply to: Daniel Gustafsson (#1)
Re: The pgperltidy diffs in HEAD

On 2025-Nov-25, Daniel Gustafsson wrote:

I routinely run pgperltidy src/ when hacking on things, and am greeted with
lots of diffs like how pgindent runs used to be. Are there objections to
applying the diffs we've accumulated so far with a .git-blame-ignore-revs
update alongside it? Are there reasons not that I am missing?

None here. I tend to run pgperltidy on individual files so this is not
normally a problem for me, but I kinda dislike that our steady status is
not clean.

Attached is the current output from pgperltidy, I haven't looked over it in
detail but I am happy to take that on assuming it's not objected to.

Hmm, I wonder if you ran this with our documented version of perltidy.
I have vague memories of pgperltidy leaving the generate-lwlocknames.pl
script the way it is now, for example. But then, maybe the one who used
the wrong perltidy version is me.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Álvaro Herrera (#2)
Re: The pgperltidy diffs in HEAD

=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:

On 2025-Nov-25, Daniel Gustafsson wrote:

I routinely run pgperltidy src/ when hacking on things, and am greeted with
lots of diffs like how pgindent runs used to be. Are there objections to
applying the diffs we've accumulated so far with a .git-blame-ignore-revs
update alongside it? Are there reasons not that I am missing?

None here. I tend to run pgperltidy on individual files so this is not
normally a problem for me, but I kinda dislike that our steady status is
not clean.

While I've not got any great objection to running pgperltidy now,
it seems like it'd be better if committers were all on the same page
about this. My understanding of the current policy is that we'll
keep the tree pgindent-clean on the fly, but worry about pgperltidy
only once a year or so. Is there consensus for tightening that up?

Hmm, I wonder if you ran this with our documented version of perltidy.

This sort of thing is why I'm hesitant. We didn't really dare expect
committers to ensure pgindent cleanliness until we had that tool
fully integrated in our tree, so that there was one true (and readily
available) version to use. perltidy still fails that test AFAIK;
you have to go looking for the agreed-on version.

regards, tom lane

#4Daniel Gustafsson
daniel@yesql.se
In reply to: Tom Lane (#3)
Re: The pgperltidy diffs in HEAD

On 25 Nov 2025, at 17:00, Tom Lane <tgl@sss.pgh.pa.us> wrote:

=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:

On 2025-Nov-25, Daniel Gustafsson wrote:

I routinely run pgperltidy src/ when hacking on things, and am greeted with
lots of diffs like how pgindent runs used to be. Are there objections to
applying the diffs we've accumulated so far with a .git-blame-ignore-revs
update alongside it? Are there reasons not that I am missing?

None here. I tend to run pgperltidy on individual files so this is not
normally a problem for me, but I kinda dislike that our steady status is
not clean.

While I've not got any great objection to running pgperltidy now,
it seems like it'd be better if committers were all on the same page
about this. My understanding of the current policy is that we'll
keep the tree pgindent-clean on the fly, but worry about pgperltidy
only once a year or so. Is there consensus for tightening that up?

I don't think there is, but I wouldn't mind if that was the case given how nice
it is to have a pgindent clean tree at all times.

Hmm, I wonder if you ran this with our documented version of perltidy.

This sort of thing is why I'm hesitant. We didn't really dare expect
committers to ensure pgindent cleanliness until we had that tool
fully integrated in our tree, so that there was one true (and readily
available) version to use. perltidy still fails that test AFAIK;
you have to go looking for the agreed-on version.

..and since I managed to run it with the wrong version for the attached diff that
argument certainly does have merit (I now gave up on having two version
installed for $reasons and will settle on the postgres-mandated version for all
things).

Maybe this is best left alone for now and made into a topic for a committer
meeting at pgconf.dev?

--
Daniel Gustafsson

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniel Gustafsson (#4)
Re: The pgperltidy diffs in HEAD

Daniel Gustafsson <daniel@yesql.se> writes:

On 25 Nov 2025, at 17:00, Tom Lane <tgl@sss.pgh.pa.us> wrote:

=?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@kurilemu.de> writes:

Hmm, I wonder if you ran this with our documented version of perltidy.

..and since I managed to run it with the wrong version for the attached diff that
argument certainly does have merit (I now gave up on having two version
installed for $reasons and will settle on the postgres-mandated version for all
things).

pgindent has long had a check that you're running the correct version
of bsdindent, but I just realized that pgperltidy makes no such check
for perltidy. Should we install one?

regards, tom lane

#6Álvaro Herrera
alvherre@kurilemu.de
In reply to: Tom Lane (#5)
Re: The pgperltidy diffs in HEAD

On 2025-Nov-25, Tom Lane wrote:

pgindent has long had a check that you're running the correct version
of bsdindent, but I just realized that pgperltidy makes no such check
for perltidy. Should we install one?

Yeah, we should definitely have that.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/

#7Daniel Gustafsson
daniel@yesql.se
In reply to: Álvaro Herrera (#6)
1 attachment(s)
Re: The pgperltidy diffs in HEAD

On 25 Nov 2025, at 18:53, Álvaro Herrera <alvherre@kurilemu.de> wrote:

On 2025-Nov-25, Tom Lane wrote:

pgindent has long had a check that you're running the correct version
of bsdindent, but I just realized that pgperltidy makes no such check
for perltidy. Should we install one?

Yeah, we should definitely have that.

Agreed. Perhaps something like the attached would work?

--
Daniel Gustafsson

Attachments:

perltidyversion.diffapplication/octet-stream; name=perltidyversion.diff; x-unix-mode=0644Download
diff --git a/src/tools/pgindent/pgperltidy b/src/tools/pgindent/pgperltidy
index 6af27d21d55..b394f392772 100755
--- a/src/tools/pgindent/pgperltidy
+++ b/src/tools/pgindent/pgperltidy
@@ -2,11 +2,18 @@
 
 # src/tools/pgindent/pgperltidy
 
-set -e
-
 # set this to override default perltidy program:
 PERLTIDY=${PERLTIDY:-perltidy}
 
+PERLTIDY_VERSION=20230309
+$PERLTIDY -v | grep -q $PERLTIDY_VERSION
+if [ $? == 1 ]; then
+	echo "error: pgperltidy requires perltidy v$PERLTIDY_VERSION"
+	exit 1
+fi
+
+set -e
+
 . src/tools/perlcheck/find_perl_files
 
 find_perl_files "$@" | xargs $PERLTIDY --profile=src/tools/pgindent/perltidyrc
#8Álvaro Herrera
alvherre@kurilemu.de
In reply to: Daniel Gustafsson (#7)
Re: The pgperltidy diffs in HEAD

On 2025-Nov-25, Daniel Gustafsson wrote:

Agreed. Perhaps something like the attached would work?

Hmm, I got this

src/tools/pgindent/pgperltidy: 10: [: 0: unexpected operator

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 feb 4 2025 /bin/sh -> dash*

(Seems to work ok silently with bash.)

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Digital and video cameras have this adjustment and film cameras don't for the
same reason dogs and cats lick themselves: because they can." (Ken Rockwell)

#9Daniel Gustafsson
daniel@yesql.se
In reply to: Álvaro Herrera (#8)
Re: The pgperltidy diffs in HEAD

On 25 Nov 2025, at 20:31, Álvaro Herrera <alvherre@kurilemu.de> wrote:

On 2025-Nov-25, Daniel Gustafsson wrote:

Agreed. Perhaps something like the attached would work?

Hmm, I got this

src/tools/pgindent/pgperltidy: 10: [: 0: unexpected operator

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 feb 4 2025 /bin/sh -> dash*

(Seems to work ok silently with bash.)

If you replace the if statement with the one below using test, does that make
it work?

if test $? = 1; then

--
Daniel Gustafsson

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniel Gustafsson (#7)
Re: The pgperltidy diffs in HEAD

Daniel Gustafsson <daniel@yesql.se> writes:

On 2025-Nov-25, Tom Lane wrote:

pgindent has long had a check that you're running the correct version
of bsdindent, but I just realized that pgperltidy makes no such check
for perltidy. Should we install one?

Agreed. Perhaps something like the attached would work?

WFM.

regards, tom lane

#11Andrew Dunstan
andrew@dunslane.net
In reply to: Daniel Gustafsson (#9)
Re: The pgperltidy diffs in HEAD

On 2025-11-25 Tu 2:36 PM, Daniel Gustafsson wrote:

On 25 Nov 2025, at 20:31, Álvaro Herrera <alvherre@kurilemu.de> wrote:

On 2025-Nov-25, Daniel Gustafsson wrote:

Agreed. Perhaps something like the attached would work?

Hmm, I got this

src/tools/pgindent/pgperltidy: 10: [: 0: unexpected operator

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 feb 4 2025 /bin/sh -> dash*

(Seems to work ok silently with bash.)

If you replace the if statement with the one below using test, does that make
it work?

if test $? = 1; then

Looks to me like your original patch had == where it should have had =

Your formulation above corrects that.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In reply to: Andrew Dunstan (#11)
Re: The pgperltidy diffs in HEAD

Andrew Dunstan <andrew@dunslane.net> writes:

On 2025-11-25 Tu 2:36 PM, Daniel Gustafsson wrote:

On 25 Nov 2025, at 20:31, Álvaro Herrera <alvherre@kurilemu.de> wrote:

On 2025-Nov-25, Daniel Gustafsson wrote:

Agreed. Perhaps something like the attached would work?

Hmm, I got this

src/tools/pgindent/pgperltidy: 10: [: 0: unexpected operator

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 feb 4 2025 /bin/sh -> dash*

(Seems to work ok silently with bash.)

If you replace the if statement with the one below using test, does that make
it work?

if test $? = 1; then

Looks to me like your original patch had == where it should have had =

Your formulation above corrects that.

Even simpler, and avoiding having to move the `set -e` after the check:

PERLTIDY_VERSION=20230309
if ! $PERLTIDY -v | grep -q $PERLTIDY_VERSION; then
echo "error: pgperltidy requires perltidy v$PERLTIDY_VERSION"
exit 1
fi

- ilmari

#13Jacob Champion
jacob.champion@enterprisedb.com
In reply to: Dagfinn Ilmari Mannsåker (#12)
Re: The pgperltidy diffs in HEAD

On Tue, Nov 25, 2025 at 2:03 PM Dagfinn Ilmari Mannsåker
<ilmari@ilmari.org> wrote:

Even simpler, and avoiding having to move the `set -e` after the check:

+1; you beat me to it by a couple seconds :)

--Jacob

#14Daniel Gustafsson
daniel@yesql.se
In reply to: Dagfinn Ilmari Mannsåker (#12)
1 attachment(s)
Re: The pgperltidy diffs in HEAD

On 25 Nov 2025, at 23:03, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> wrote:

Even simpler, and avoiding having to move the `set -e` after the check:

PERLTIDY_VERSION=20230309
if ! $PERLTIDY -v | grep -q $PERLTIDY_VERSION; then
echo "error: pgperltidy requires perltidy v$PERLTIDY_VERSION"
exit 1
fi

Ah, even better, thanks!

--
Daniel Gustafsson

Attachments:

v2_perltidyversion.diffapplication/octet-stream; name=v2_perltidyversion.diff; x-unix-mode=0644Download
diff --git a/doc/src/sgml/func/func-string.sgml b/doc/src/sgml/func/func-string.sgml
index 7ad1436e5f8..646b5d6d8c4 100644
--- a/doc/src/sgml/func/func-string.sgml
+++ b/doc/src/sgml/func/func-string.sgml
@@ -173,7 +173,7 @@
         <returnvalue>integer</returnvalue>
        </para>
        <para role="func_signature">
-        <indexterm>
+        <indexterm id="function-character-length">
          <primary>character_length</primary>
         </indexterm>
         <function>character_length</function> ( <type>text</type> )
@@ -208,7 +208,7 @@
 
       <row>
        <entry role="func_table_entry"><para role="func_signature">
-        <indexterm>
+        <indexterm id="function-lpad">
          <primary>lpad</primary>
         </indexterm>
         <function>lpad</function> ( <parameter>string</parameter> <type>text</type>,
@@ -277,7 +277,7 @@
 
       <row>
        <entry role="func_table_entry"><para role="func_signature">
-        <indexterm>
+        <indexterm id="function-octet-length">
          <primary>octet_length</primary>
         </indexterm>
         <function>octet_length</function> ( <type>text</type> )
@@ -1334,7 +1334,7 @@
 
       <row>
        <entry role="func_table_entry"><para role="func_signature">
-        <indexterm>
+        <indexterm id="function-string-to-table">
          <primary>string_to_table</primary>
         </indexterm>
         <function>string_to_table</function> ( <parameter>string</parameter> <type>text</type>, <parameter>delimiter</parameter> <type>text</type> <optional>, <parameter>null_string</parameter> <type>text</type> </optional> )
diff --git a/src/tools/pgindent/pgperltidy b/src/tools/pgindent/pgperltidy
index 6af27d21d55..6fac758665a 100755
--- a/src/tools/pgindent/pgperltidy
+++ b/src/tools/pgindent/pgperltidy
@@ -7,6 +7,12 @@ set -e
 # set this to override default perltidy program:
 PERLTIDY=${PERLTIDY:-perltidy}
 
+PERLTIDY_VERSION=20230309
+if ! $PERLTIDY -v | grep -q $PERLTIDY_VERSION; then
+	echo "error: pgperltidy requires perltidy v$PERLTIDY_VERSION"
+	exit 1
+fi
+
 . src/tools/perlcheck/find_perl_files
 
 find_perl_files "$@" | xargs $PERLTIDY --profile=src/tools/pgindent/perltidyrc
In reply to: Daniel Gustafsson (#14)
Re: The pgperltidy diffs in HEAD

Daniel Gustafsson <daniel@yesql.se> writes:

[2. text/x-diff; v2_perltidyversion.diff]
diff --git a/doc/src/sgml/func/func-string.sgml b/doc/src/sgml/func/func-string.sgml
index 7ad1436e5f8..646b5d6d8c4 100644
--- a/doc/src/sgml/func/func-string.sgml
+++ b/doc/src/sgml/func/func-string.sgml
@@ -173,7 +173,7 @@

This seems unrelated to the rest of the patch patch.

diff --git a/src/tools/pgindent/pgperltidy b/src/tools/pgindent/pgperltidy
index 6af27d21d55..6fac758665a 100755
--- a/src/tools/pgindent/pgperltidy
+++ b/src/tools/pgindent/pgperltidy
@@ -7,6 +7,12 @@ set -e
# set this to override default perltidy program:
PERLTIDY=${PERLTIDY:-perltidy}
+PERLTIDY_VERSION=20230309
+if ! $PERLTIDY -v | grep -q $PERLTIDY_VERSION; then
+	echo "error: pgperltidy requires perltidy v$PERLTIDY_VERSION"

I just realised, this message should really go to stderr, i.e. have >&2
on the end.

+	exit 1
+fi
+
. src/tools/perlcheck/find_perl_files

find_perl_files "$@" | xargs $PERLTIDY --profile=src/tools/pgindent/perltidyrc

- ilmari

#16Daniel Gustafsson
daniel@yesql.se
In reply to: Dagfinn Ilmari Mannsåker (#15)
Re: The pgperltidy diffs in HEAD

On 26 Nov 2025, at 12:11, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> wrote:

This seems unrelated to the rest of the patch patch.

Yeah, I was working on a docs-patch in the same tree and only realized this
morning that I had accidentally included that part =)

diff --git a/src/tools/pgindent/pgperltidy b/src/tools/pgindent/pgperltidy
index 6af27d21d55..6fac758665a 100755
--- a/src/tools/pgindent/pgperltidy
+++ b/src/tools/pgindent/pgperltidy
@@ -7,6 +7,12 @@ set -e
# set this to override default perltidy program:
PERLTIDY=${PERLTIDY:-perltidy}
+PERLTIDY_VERSION=20230309
+if ! $PERLTIDY -v | grep -q $PERLTIDY_VERSION; then
+ echo "error: pgperltidy requires perltidy v$PERLTIDY_VERSION"

I just realised, this message should really go to stderr, i.e. have >&2
on the end.

Good point, I'll change that before committing and I'll also reword it to use
the same error as pgindent which has this:

"You do not appear to have $indent version $INDENT_VERSION installed on your system.\n";

Consistency is good.

--
Daniel Gustafsson

#17Daniel Gustafsson
daniel@yesql.se
In reply to: Daniel Gustafsson (#16)
1 attachment(s)
Re: The pgperltidy diffs in HEAD

On 26 Nov 2025, at 12:16, Daniel Gustafsson <daniel@yesql.se> wrote:

I'll change that before committing and I'll also reword it to use
the same error as pgindent

More specifically, the attached is what I have staged for commit.

--
Daniel Gustafsson

Attachments:

v3-0001-Check-for-correct-version-of-perltidy.patchapplication/octet-stream; name=v3-0001-Check-for-correct-version-of-perltidy.patch; x-unix-mode=0644Download
From cc96a85c5cb5c5895581f8474d8d62be7dce4e3e Mon Sep 17 00:00:00 2001
From: Daniel Gustafsson <dgustafsson@postgresql.org>
Date: Wed, 26 Nov 2025 17:12:22 +0100
Subject: [PATCH v3] Check for correct version of perltidy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

pgperltidy requires a particular version of perltidy, but the version
wasn't checked like how pgindent checks the underlying indent binary.
Fix by checking the version of perltidy and error out if an incorrect
version is used.

Author: Daniel Gustafsson <daniel@yesql.se>
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/1209850.1764092152@sss.pgh.pa.us
---
 src/tools/pgindent/pgperltidy | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/tools/pgindent/pgperltidy b/src/tools/pgindent/pgperltidy
index 6af27d21d55..87838d6bde3 100755
--- a/src/tools/pgindent/pgperltidy
+++ b/src/tools/pgindent/pgperltidy
@@ -7,6 +7,12 @@ set -e
 # set this to override default perltidy program:
 PERLTIDY=${PERLTIDY:-perltidy}
 
+PERLTIDY_VERSION=20230309
+if ! $PERLTIDY -v | grep -q $PERLTIDY_VERSION; then
+	echo "You do not appear to have $PERLTIDY version $PERLTIDY_VERSION installed on your system." >&2
+	exit 1
+fi
+
 . src/tools/perlcheck/find_perl_files
 
 find_perl_files "$@" | xargs $PERLTIDY --profile=src/tools/pgindent/perltidyrc
-- 
2.39.3 (Apple Git-146)

In reply to: Daniel Gustafsson (#17)
Re: The pgperltidy diffs in HEAD

Daniel Gustafsson <daniel@yesql.se> writes:

On 26 Nov 2025, at 12:16, Daniel Gustafsson <daniel@yesql.se> wrote:

I'll change that before committing and I'll also reword it to use
the same error as pgindent

More specifically, the attached is what I have staged for commit.

LGTM

--
Daniel Gustafsson

- ilmari