Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check_archive_ready for version 10 and above #204

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions check_postgres.pl
Original file line number Diff line number Diff line change
Expand Up @@ -9423,8 +9423,17 @@ sub check_wal_files {

## Figure out where the pg_xlog directory is
$SQL = qq{SELECT count(*) AS count FROM $lsfunc($lsargs) WHERE $lsfunc ~ E'^[0-9A-F]{24}$extrabit\$'}; ## no critic (RequireInterpolationOfMetachars)
my $SQL10 = $opt{lsfunc} ? $SQL :
qq{SELECT count(*) AS count FROM pg_ls_waldir() WHERE name ~ E'^[0-9A-F]{24}$extrabit\$'}; ## no critic (RequireInterpolationOfMetachars)
my $SQL10 = "";

if ($extrabit) {
# check_archive_ready
$SQL10 = $opt{lsfunc} ? $SQL :
qq{SELECT count(*) AS count FROM pg_ls_archive_statusdir() WHERE name ~ E'^[0-9A-F]{24}$extrabit\$'}; ## no critic (RequireInterpolationOfMetachars)
} else {
# check_wal_files
$SQL10 = $opt{lsfunc} ? $SQL :
qq{SELECT count(*) AS count FROM pg_ls_waldir() WHERE name ~ E'^[0-9A-F]{24}\$'}; ## no critic (RequireInterpolationOfMetachars)
}

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

Expand Down