Skip to content

Commit

Permalink
Ignore functions that cannot be executed during recovery.
Browse files Browse the repository at this point in the history
  • Loading branch information
tgxworld authored and wrouesnel committed Jun 6, 2017
1 parent 5c587cb commit 0de0311
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions postgres_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,16 @@ var queryOverrides = map[string][]OverrideQuery{
semver.MustParseRange(">=9.2.0"),
`
SELECT *,
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_current_xlog_location() end) AS pg_current_xlog_location,
(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
`,
},
{
semver.MustParseRange("<9.2.0"),
`
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
`,
},
Expand Down

0 comments on commit 0de0311

Please sign in to comment.