mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 14:46:29 +00:00
Make repmgr metadata tables dumpable
This makes it easier to extract data for troubleshooting.
This commit is contained in:
1
HISTORY
1
HISTORY
@@ -15,6 +15,7 @@
|
||||
repmgr: improve output formatting for cluster matrix/crosscheck (Ian)
|
||||
repmgr: improve database connection failure error checking on the
|
||||
demotion candidate during "standby switchover" (Ian)
|
||||
repmgr: make repmgr metadata tables dumpable (Ian)
|
||||
repmgr: fix issue with tablespace mapping when cloning from Barman;
|
||||
GitHub #650 (Ian)
|
||||
repmgr: improve handling of pg_control read errors (Ian)
|
||||
|
||||
@@ -379,6 +379,22 @@
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="faq-repmgr-exclude-metadata-from-dump" xreflabel="Excluding repmgr metadata from pg_dump output">
|
||||
<title>How can I exclude &repmgr; metadata from <application>pg_dump</application> output?</title>
|
||||
<para>
|
||||
Beginning with &repmgr; 5.2, the metadata tables associated with the &repmgr; extension
|
||||
(<literal>repmgr.nodes</literal>, <literal>repmgr.events</literal> and <literal>repmgr.monitoring_history</literal>)
|
||||
have been marked as dumpable as they contain configuration and user-generated data.
|
||||
</para>
|
||||
<para>
|
||||
To exclude these from <application>pg_dump</application> output, add the flag <option>--exclude-schema=repmgr</option>.
|
||||
</para>
|
||||
<para>
|
||||
To exclude individual &repmgr; metadata tables from <application>pg_dump</application> output, add the flag
|
||||
e.g. <option>--exclude-table=repmgr.monitoring_history</option>. This flag can be provided multiple times
|
||||
to exclude individual tables,
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
||||
@@ -133,6 +133,12 @@
|
||||
Improve handling of pg_control read errors.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
It is now possible to dump the contents of &repmgr; metadata tables with
|
||||
<application>pg_dump</application>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||
\echo Use "CREATE EXTENSION repmgr" to load this file. \quit
|
||||
|
||||
SELECT pg_catalog.pg_extension_config_dump('repmgr.nodes', '');
|
||||
SELECT pg_catalog.pg_extension_config_dump('repmgr.events', '');
|
||||
SELECT pg_catalog.pg_extension_config_dump('repmgr.monitoring_history', '');
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user