Fix version check in postgresql_extensible (#4866)
This commit is contained in:
parent
0003c8fba7
commit
69d21a5876
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue