Skip to content

Commit 2ad675d

Browse files
author
Greg Sabino Mullane
committed
Add some minor casting to help with the bloat query.
1 parent f27832a commit 2ad675d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

check_postgres.pl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ package check_postgres;
3232

3333
binmode STDOUT, ':encoding(UTF-8)';
3434

35-
our $VERSION = '2.22.0';
35+
our $VERSION = '2.22.1';
3636

3737
use vars qw/ %opt $PGBINDIR $PSQL $res $COM $SQL $db /;
3838

@@ -3807,12 +3807,12 @@ sub check_bloat {
38073807
ROUND(CASE WHEN otta=0 OR sml.relpages=0 OR sml.relpages=otta THEN 0.0 ELSE sml.relpages/otta::numeric END,1) AS tbloat,
38083808
CASE WHEN relpages < otta THEN 0 ELSE relpages::bigint - otta END AS wastedpages,
38093809
CASE WHEN relpages < otta THEN 0 ELSE bs*(sml.relpages-otta)::bigint END AS wastedbytes,
3810-
CASE WHEN relpages < otta THEN '0 bytes'::text ELSE (bs*(relpages-otta))::bigint || ' bytes' END AS wastedsize,
3810+
CASE WHEN relpages < otta THEN '0 bytes'::text ELSE (bs*(relpages-otta))::bigint::text || ' bytes' END AS wastedsize,
38113811
iname, ituples::bigint AS itups, ipages::bigint AS ipages, iotta,
38123812
ROUND(CASE WHEN iotta=0 OR ipages=0 OR ipages=iotta THEN 0.0 ELSE ipages/iotta::numeric END,1) AS ibloat,
38133813
CASE WHEN ipages < iotta THEN 0 ELSE ipages::bigint - iotta END AS wastedipages,
38143814
CASE WHEN ipages < iotta THEN 0 ELSE bs*(ipages-iotta) END AS wastedibytes,
3815-
CASE WHEN ipages < iotta THEN '0 bytes' ELSE (bs*(ipages-iotta))::bigint || ' bytes' END AS wastedisize,
3815+
CASE WHEN ipages < iotta THEN '0 bytes' ELSE (bs*(ipages-iotta))::bigint::text || ' bytes' END AS wastedisize,
38163816
CASE WHEN relpages < otta THEN
38173817
CASE WHEN ipages < iotta THEN 0 ELSE bs*(ipages-iotta::bigint) END
38183818
ELSE CASE WHEN ipages < iotta THEN bs*(relpages-otta::bigint)
@@ -8238,7 +8238,7 @@ =head1 NAME
82388238
82398239
B<check_postgres.pl> - a Postgres monitoring script for Nagios, MRTG, Cacti, and others
82408240
8241-
This documents describes check_postgres.pl version 2.22.0
8241+
This documents describes check_postgres.pl version 2.22.1
82428242
82438243
=head1 SYNOPSIS
82448244
@@ -10122,7 +10122,7 @@ =head1 HISTORY
1012210122
1012310123
=over 4
1012410124
10125-
=item B<Version 2.22.1> ????, 2015
10125+
=item B<Version 2.22.1> Released ????
1012610126
1012710127
Add Spanish message translations
1012810128
(Luis Vazquez)
@@ -10131,6 +10131,10 @@ =head1 HISTORY
1013110131
non-superuser
1013210132
(Joshua Elsasser)
1013310133
10134+
Add some defensive casting to the bloat query
10135+
(Greg Sabino Mullane)
10136+
10137+
1013410138
=item B<Version 2.22.0> June 30, 2015
1013510139
1013610140
Add xact timestamp support to hot_standby_delay.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy