[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 5d7127e4e4
commit 02d40565c6
2 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@
### Bugfixes ### Bugfixes
- [#2819](https://github.com/influxdata/telegraf/pull/2819): [enh] set db_version at 0 if query version fails
- [#2749](https://github.com/influxdata/telegraf/pull/2749): Fixed sqlserver input to work with case sensitive server collation. - [#2749](https://github.com/influxdata/telegraf/pull/2749): Fixed sqlserver input to work with case sensitive server collation.
- [#2716](https://github.com/influxdata/telegraf/pull/2716): Systemd does not see all shutdowns as failures - [#2716](https://github.com/influxdata/telegraf/pull/2716): Systemd does not see all shutdowns as failures
- [#2782](https://github.com/influxdata/telegraf/pull/2782): Reuse transports in input plugins - [#2782](https://github.com/influxdata/telegraf/pull/2782): Reuse transports in input plugins

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'` 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) err = db.QueryRow(query).Scan(&db_version)
if err != nil { if err != nil {
return err db_version = 0
} }
// We loop in order to process each query // We loop in order to process each query
// Query is not run if Database version does not match the query version. // Query is not run if Database version does not match the query version.