Skip to content

Commit

Permalink
Fix version check in postgresql_extensible (influxdata#4866)
Browse files Browse the repository at this point in the history
  • Loading branch information
axinojolais authored and otherpirate committed Mar 15, 2019
1 parent 715e134 commit 5a5cf2a
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 5a5cf2a

Please sign in to comment.