Add new parameter to recovery_1st_stage_command and recovery_2nd_stage_command.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 5 Aug 2021 07:45:46 +0000 (16:45 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Thu, 5 Aug 2021 07:45:46 +0000 (16:45 +0900)
The new parameter represents the primary (main) server host name which
is defined in backend_hostname parameter. The commands used to obtain
the host name by using hostname command. This is usually fine but in
some systems the host name returned by hostname command is not same as
backend_hostname. This brings problem to detach_false_primary feature.

Note that documentations are not completed in this commit because of
my development environment (Ubuntu 20) issue (openjade crashes). I
will push document changes later using another PC.

Discussion:
https://www.pgpool.net/pipermail/pgpool-hackers/2021-July/003943.html
https://www.pgpool.net/pipermail/pgpool-hackers/2021-July/003974.html

src/sql/pgpool-recovery/pgpool_recovery--1.3--1.4.sql [new file with mode: 0644]
src/sql/pgpool-recovery/pgpool_recovery--1.4.sql [new file with mode: 0644]

diff --git a/src/sql/pgpool-recovery/pgpool_recovery--1.3--1.4.sql b/src/sql/pgpool-recovery/pgpool_recovery--1.3--1.4.sql
new file mode 100644 (file)
index 0000000..9db78a0
--- /dev/null
@@ -0,0 +1,9 @@
+/* contrib/pgpool_recovery/pgpool_recovery--1.3--1.4.sql */
+
+-- complain if script is sourced in psql, rather than via ALTER EXTENSION
+\echo Use "ALTER EXTENSION pgpool_recovery UPDATE TO '1.4'" to load this file. \quit
+
+create FUNCTION pgpool_recovery(script_name text, remote_host text, remote_data_directory text, primary_port text, remote_node integer, remote_port text, primary_host text)
+RETURNS bool
+AS 'MODULE_PATHNAME', 'pgpool_recovery'
+LANGUAGE C STRICT;
diff --git a/src/sql/pgpool-recovery/pgpool_recovery--1.4.sql b/src/sql/pgpool-recovery/pgpool_recovery--1.4.sql
new file mode 100644 (file)
index 0000000..b82d827
--- /dev/null
@@ -0,0 +1,52 @@
+-- complain if script is sourced in psql, rather than via CREATE EXTENSION
+\echo Use "CREATE EXTENSION pgpool_recovery" to load this file. \quit
+
+CREATE FUNCTION pgpool_recovery(IN script_name text,
+          IN remote_host text,
+          IN remote_data_directory text,
+          IN primary_port text,
+          IN remote_node integer,
+          IN remote_port text,
+          IN primary_host text)
+RETURNS bool
+AS 'MODULE_PATHNAME', 'pgpool_recovery'
+LANGUAGE C STRICT;
+
+CREATE FUNCTION pgpool_recovery(IN script_name text,
+          IN remote_host text,
+          IN remote_data_directory text,
+          IN primary_port text,
+          IN remote_node integer)
+RETURNS bool
+AS 'MODULE_PATHNAME', 'pgpool_recovery'
+LANGUAGE C STRICT;
+
+CREATE FUNCTION pgpool_recovery(IN script_name text,
+          IN remote_host text,
+          IN remote_data_directory text,
+          IN primary_port text)
+RETURNS bool
+AS 'MODULE_PATHNAME', 'pgpool_recovery'
+LANGUAGE C STRICT;
+
+CREATE FUNCTION pgpool_recovery(IN script_name text,
+          IN remote_host text,
+          IN remote_data_directory text)
+RETURNS bool
+AS 'MODULE_PATHNAME', 'pgpool_recovery'
+LANGUAGE C STRICT;
+
+CREATE FUNCTION pgpool_remote_start(IN remote_host text, IN remote_data_directory text)
+RETURNS bool
+AS 'MODULE_PATHNAME', 'pgpool_remote_start'
+LANGUAGE C STRICT;
+
+CREATE FUNCTION pgpool_pgctl(IN action text, IN stop_mode text)
+RETURNS bool
+AS '$libdir/pgpool-recovery', 'pgpool_pgctl'
+LANGUAGE C STRICT;
+
+CREATE FUNCTION pgpool_switch_xlog(IN archive_dir text)
+RETURNS text
+AS 'MODULE_PATHNAME', 'pgpool_switch_xlog'
+LANGUAGE C STRICT;