Skip to content

Commit

Permalink
Fix version check in postgresql_extensible (#4866)
Browse files Browse the repository at this point in the history
(cherry picked from commit 69d21a5)
  • Loading branch information
axinojolais authored and glinton committed Oct 30, 2018
1 parent b73dda8 commit 20529cc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (p *Postgresql) Gather(acc telegraf.Accumulator) error {
)

// Retreiving the database version
query = `select substring(setting from 1 for 3) as version from pg_settings where name='server_version_num'`
query = `SELECT setting::integer / 100 AS version FROM pg_settings WHERE name = 'server_version_num'`
if err = p.DB.QueryRow(query).Scan(&db_version); err != nil {
db_version = 0
}
Expand Down

0 comments on commit 20529cc

Please sign in to comment.