Make repmgr metadata tables dumpable

This makes it easier to extract data for troubleshooting.
This commit is contained in:
Ian Barwick
2020-10-12 10:02:52 +09:00
parent b195547525
commit d62743ddf4
5 changed files with 33 additions and 1 deletions

View File

@@ -15,6 +15,8 @@ CREATE TABLE repmgr.nodes (
config_file TEXT NOT NULL
);
SELECT pg_catalog.pg_extension_config_dump('repmgr.nodes', '');
CREATE TABLE repmgr.events (
node_id INTEGER NOT NULL,
event TEXT NOT NULL,
@@ -23,6 +25,7 @@ CREATE TABLE repmgr.events (
details TEXT NULL
);
SELECT pg_catalog.pg_extension_config_dump('repmgr.events', '');
CREATE TABLE repmgr.monitoring_history (
primary_node_id INTEGER NOT NULL,
@@ -35,10 +38,11 @@ CREATE TABLE repmgr.monitoring_history (
apply_lag BIGINT NOT NULL
);
CREATE INDEX idx_monitoring_history_time
ON repmgr.monitoring_history (last_monitor_time, standby_node_id);
SELECT pg_catalog.pg_extension_config_dump('repmgr.monitoring_history', '');
CREATE VIEW repmgr.show_nodes AS
SELECT n.node_id,
n.node_name,