Ignore functions that cannot be executed during recovery.

https://github.com/wrouesnel/postgres_exporter/issues/52
This commit is contained in:
Guo Xiang Tan 2017-06-01 23:13:16 +09:00 committed by Will Rouesnel
parent 5c587cb725
commit 0de0311c22

View File

@ -293,8 +293,8 @@ var queryOverrides = map[string][]OverrideQuery{
semver.MustParseRange(">=9.2.0"), semver.MustParseRange(">=9.2.0"),
` `
SELECT *, SELECT *,
pg_current_xlog_location(), (case pg_is_in_recovery() when 't' then null else pg_current_xlog_location() end) AS pg_current_xlog_location,
pg_xlog_location_diff(pg_current_xlog_location(), replay_location)::float (case pg_is_in_recovery() when 't' then null else pg_xlog_location_diff(pg_current_xlog_location(), replay_location)::float end) AS pg_xlog_location_diff
FROM pg_stat_replication FROM pg_stat_replication
`, `,
}, },
@ -302,7 +302,7 @@ var queryOverrides = map[string][]OverrideQuery{
semver.MustParseRange("<9.2.0"), semver.MustParseRange("<9.2.0"),
` `
SELECT *, SELECT *,
pg_current_xlog_location() (case pg_is_in_recovery() when 't' then null else pg_current_xlog_location() end) AS pg_current_xlog_location,
FROM pg_stat_replication FROM pg_stat_replication
`, `,
}, },