Fix version check in postgresql_extensible (#4866)

This commit is contained in:
Beaujolais ! 2018-10-30 22:06:47 +01:00 committed by Greg
parent 0003c8fba7
commit 69d21a5876
1 changed files with 1 additions and 1 deletions

View File

@ -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
}