** Copyright (C) 2001-2022 Zabbix SIA
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"git.zabbix.com/ap/plugin-support/metric"
"git.zabbix.com/ap/plugin-support/plugin"
"git.zabbix.com/ap/plugin-support/uri"
keyArchiveSize = "pgsql.archive"
keyAutovacuum = "pgsql.autovacuum.count"
keyBgwriter = "pgsql.bgwriter"
keyCache = "pgsql.cache.hit"
keyConnections = "pgsql.connections"
keyCustomQuery = "pgsql.custom.query"
keyDBStat = "pgsql.dbstat"
keyDBStatSum = "pgsql.dbstat.sum"
keyDatabaseAge = "pgsql.db.age"
keyDatabasesBloating = "pgsql.db.bloating_tables"
keyDatabasesDiscovery = "pgsql.db.discovery"
keyDatabaseSize = "pgsql.db.size"
keyOldestXid = "pgsql.oldest.xid"
keyQueries = "pgsql.queries"
keyReplicationCount = "pgsql.replication.count"
keyReplicationLagB = "pgsql.replication.lag.b"
keyReplicationLagSec = "pgsql.replication.lag.sec"
keyReplicationProcessInfo = "pgsql.replication.process"
keyReplicationProcessNameDiscovery = "pgsql.replication.process.discovery"
keyReplicationRecoveryRole = "pgsql.replication.recovery_role"
keyReplicationStatus = "pgsql.replication.status"
keyUptime = "pgsql.uptime"
keyWal = "pgsql.wal.stat"
// handlerFunc defines an interface must be implemented by handlers.
type handlerFunc func(ctx context.Context, conn PostgresClient, key string,