projects
/
check_postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86f81cf
)
Change join to pg_user to a left join, as the database may be owned by a role.
author
Greg Sabino Mullane
<
[email protected]
>
Wed, 23 Nov 2011 14:13:46 +0000
(09:13 -0500)
committer
Greg Sabino Mullane
<
[email protected]
>
Wed, 23 Nov 2011 14:13:46 +0000
(09:13 -0500)
Thanks to Emmanuel Lesouef for the bug report and help in tracking this down.
There are probably other incorrect inner joins to pg_user in the code.
check_postgres.pl
patch
|
blob
|
blame
|
history
diff --git
a/check_postgres.pl
b/check_postgres.pl
index 622c5d437f5cdc5f2760cd5bbe253c761b8a9476..3b5852365daebedb7b7ad01b4496bbf502f2e45c 100755
(executable)
--- a/
check_postgres.pl
+++ b/
check_postgres.pl
@@
-3978,7
+3978,7
@@
SELECT pg_database_size(d.oid) AS dsize,
datname,
usename
FROM pg_database d
-JOIN pg_user u ON (u.usesysid=d.datdba)$USERWHERECLAUSE
+
LEFT
JOIN pg_user u ON (u.usesysid=d.datdba)$USERWHERECLAUSE
};
if ($opt{perflimit}) {
$SQL .= " ORDER BY 1 DESC LIMIT $opt{perflimit}";