add query for v9.1 (#203)

This commit is contained in:
tshohe 2018-07-17 00:18:08 +09:00 committed by Will Rouesnel
parent 3d0c258c72
commit 763159e1d2
1 changed files with 11 additions and 1 deletions

View File

@ -338,7 +338,17 @@ var queryOverrides = map[string][]OverrideQuery{
ON tmp.state = tmp2.state AND pg_database.datname = tmp2.datname
`,
},
// No query is applicable for 9.1 that gives any sensible data.
{
semver.MustParseRange("<9.2.0"),
`
SELECT
datname,
'unknown' AS state,
COALESCE(count(*),0) AS count,
COALESCE(MAX(EXTRACT(EPOCH FROM now() - xact_start))::float,0) AS max_tx_duration
FROM pg_stat_activity GROUP BY datname
`,
},
},
}