From 02d40565c6ab852069e743b6aa45bc9b88cfe0dd Mon Sep 17 00:00:00 2001 From: mced Date: Thu, 18 May 2017 22:52:56 +0200 Subject: [PATCH] [enh] set db_version at 0 if query version fails (#2819) --- CHANGELOG.md | 1 + plugins/inputs/postgresql_extensible/postgresql_extensible.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c462fb8e4620..b54737e4c0df1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### 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. - [#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 diff --git a/plugins/inputs/postgresql_extensible/postgresql_extensible.go b/plugins/inputs/postgresql_extensible/postgresql_extensible.go index 24326511e0b03..1536f115cdfb4 100644 --- a/plugins/inputs/postgresql_extensible/postgresql_extensible.go +++ b/plugins/inputs/postgresql_extensible/postgresql_extensible.go @@ -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.