Skip to content

Commit 680aa4a

Browse files
committed
Fix check_archive_ready for version 10 and above
This addresses issue #150.
1 parent 89249c3 commit 680aa4a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

check_postgres.pl

+11-2
Original file line numberDiff line numberDiff line change
@@ -9423,8 +9423,17 @@ sub check_wal_files {
94239423

94249424
## Figure out where the pg_xlog directory is
94259425
$SQL = qq{SELECT count(*) AS count FROM $lsfunc($lsargs) WHERE $lsfunc ~ E'^[0-9A-F]{24}$extrabit\$'}; ## no critic (RequireInterpolationOfMetachars)
9426-
my $SQL10 = $opt{lsfunc} ? $SQL :
9427-
qq{SELECT count(*) AS count FROM pg_ls_waldir() WHERE name ~ E'^[0-9A-F]{24}$extrabit\$'}; ## no critic (RequireInterpolationOfMetachars)
9426+
my $SQL10 = "";
9427+
9428+
if ($extrabit) {
9429+
# check_archive_ready
9430+
$SQL10 = $opt{lsfunc} ? $SQL :
9431+
qq{SELECT count(*) AS count FROM pg_ls_archive_statusdir() WHERE name ~ E'^[0-9A-F]{24}$extrabit\$'}; ## no critic (RequireInterpolationOfMetachars)
9432+
} else {
9433+
# check_wal_files
9434+
$SQL10 = $opt{lsfunc} ? $SQL :
9435+
qq{SELECT count(*) AS count FROM pg_ls_waldir() WHERE name ~ E'^[0-9A-F]{24}\$'}; ## no critic (RequireInterpolationOfMetachars)
9436+
}
94289437

94299438
my $info = run_command($SQL, {regex => qr[\d], version => [">9.6 $SQL10"] });
94309439

0 commit comments

Comments
 (0)