Skip to content

Commit

Permalink
Collect pending_restart only for pg >= v9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevan committed Oct 11, 2021
1 parent bbd9f0d commit ee06d8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions collector/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,10 @@ func (c *collector) getSettings() {
pending_restart
FROM pg_settings
ORDER BY name ASC`
if c.version < pgv95 { // pending_restart was added in pg9.5
q = strings.Replace(q, "pending_restart", "FALSE", 1)
}

rows, err := c.db.QueryContext(ctx, q)
if err != nil {
log.Fatalf("pg_settings query failed: %v", err)
Expand Down

0 comments on commit ee06d8e

Please sign in to comment.