Skip to content

Commit

Permalink
Merge pull request #88 from frost242/master
Browse files Browse the repository at this point in the history
Fix tli output in check_wal_files to work properly with tli > 9
  • Loading branch information
ioguix authored Mar 1, 2017
2 parents d822d2c + 7261311 commit 693ceb6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions check_pgactivity
Original file line number Diff line number Diff line change
Expand Up @@ -6445,7 +6445,7 @@ sub check_wal_files {
ELSE pg_current_xlog_location()
END,
current_setting('wal_keep_segments')::integer,
substring(s.f from 1 for 8)::integer AS tli
substring(s.f from 1 for 8) AS tli
FROM pg_ls_dir('pg_xlog') AS s(f)
CROSS JOIN wal_settings
WHERE f ~ '^[0-9A-F]{24}$'
Expand All @@ -6465,7 +6465,7 @@ sub check_wal_files {
ELSE pg_current_xlog_location()
END,
current_setting('wal_keep_segments')::integer,
substring(s.f from 1 for 8)::integer AS tli
substring(s.f from 1 for 8) AS tli
FROM pg_ls_dir('pg_xlog') AS s(f)
WHERE f ~ '^[0-9A-F]{24}$'
ORDER BY
Expand All @@ -6477,7 +6477,7 @@ sub check_wal_files {
current_setting('checkpoint_segments')::float4
* ( 2 + current_setting('checkpoint_completion_target')::float4 )
), pg_current_xlog_location(),
NULL, substring(s.f from 1 for 8)::integer AS tli
NULL, substring(s.f from 1 for 8) AS tli
FROM pg_ls_dir('pg_xlog') AS s(f)
WHERE f ~ '^[0-9A-F]{24}$'
ORDER BY
Expand All @@ -6486,7 +6486,7 @@ sub check_wal_files {
$PG_VERSION_82 => q{
SELECT s.f,
1 + (current_setting('checkpoint_segments')::integer * 2), pg_current_xlog_location(),
NULL, substring(s.f from 1 for 8)::integer AS tli
NULL, substring(s.f from 1 for 8) AS tli
FROM pg_ls_dir('pg_xlog') AS s(f)
WHERE f ~ '^[0-9A-F]{24}$'
ORDER BY
Expand All @@ -6495,7 +6495,7 @@ sub check_wal_files {
$PG_VERSION_81 => q{
SELECT s.f,
1 + (current_setting('checkpoint_segments')::integer * 2),
NULL, NULL, substring(s.f from 1 for 8)::integer AS tli
NULL, NULL, substring(s.f from 1 for 8) AS tli
FROM pg_ls_dir('pg_xlog') AS s(f)
WHERE f ~ '^[0-9A-F]{24}$'
ORDER BY
Expand Down Expand Up @@ -6533,7 +6533,7 @@ sub check_wal_files {

$first_seg = $rs[0][0];
$max_segs = $rs[0][1];
$tli = $rs[0][4];
$tli = hex($rs[0][4]);

foreach my $r (@rs) {
$num_seg++;
Expand Down

0 comments on commit 693ceb6

Please sign in to comment.