From b19554752570b4b568241e93149c1e088946eb3a Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Mon, 12 Oct 2020 09:32:37 +0900 Subject: [PATCH] Remove hack to create pre-9.4 monitoring history table The pg_lsn datatype was introduced in PostgreSQL 9.4, and we no longer need to support earlier versions. --- repmgr--5.2.sql | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/repmgr--5.2.sql b/repmgr--5.2.sql index 8f04a821..98cd87c0 100644 --- a/repmgr--5.2.sql +++ b/repmgr--5.2.sql @@ -23,16 +23,7 @@ CREATE TABLE repmgr.events ( details TEXT NULL ); -DO $repmgr$ -DECLARE - DECLARE server_version_num INT; -BEGIN - SELECT setting - FROM pg_catalog.pg_settings - WHERE name = 'server_version_num' - INTO server_version_num; - IF server_version_num >= 90400 THEN - EXECUTE $repmgr_func$ + CREATE TABLE repmgr.monitoring_history ( primary_node_id INTEGER NOT NULL, standby_node_id INTEGER NOT NULL, @@ -42,24 +33,7 @@ CREATE TABLE repmgr.monitoring_history ( last_wal_standby_location PG_LSN, replication_lag BIGINT NOT NULL, apply_lag BIGINT NOT NULL -) - $repmgr_func$; - ELSE - EXECUTE $repmgr_func$ -CREATE TABLE repmgr.monitoring_history ( - primary_node_id INTEGER NOT NULL, - standby_node_id INTEGER NOT NULL, - last_monitor_time TIMESTAMP WITH TIME ZONE NOT NULL, - last_apply_time TIMESTAMP WITH TIME ZONE, - last_wal_primary_location TEXT NOT NULL, - last_wal_standby_location TEXT, - replication_lag BIGINT NOT NULL, - apply_lag BIGINT NOT NULL -) - $repmgr_func$; - END IF; -END$repmgr$; - +); CREATE INDEX idx_monitoring_history_time