[enh] set db_version at 0 if query version fails (#2819)

This commit is contained in:
mced
2017-05-18 22:52:56 +02:00
committed by Daniel Nelson
parent 7155e90f66
commit 501c22478e
2 changed files with 2 additions and 1 deletions

View File

@@ -141,7 +141,7 @@ func (p *Postgresql) Gather(acc telegraf.Accumulator) error {
query = `select substring(setting from 1 for 3) as version from pg_settings where name='server_version_num'`
err = db.QueryRow(query).Scan(&db_version)
if err != nil {
return err
db_version = 0
}
// We loop in order to process each query
// Query is not run if Database version does not match the query version.