mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 14:46:29 +00:00
Fix upgrade paths from 4.1 ~ 4.3 to 5.2 and later
A number of C functions were added in releases 4.2 to 4.4; however these were renamed in 5.3 to prevent naming clashes with other extensions. This does however mean that when upgrading from one of the above versions, the intermediate upgrade steps will attempt to create SQL functions referencing C functions which no longer exist in repmgr.so, and hence cause the upgrade to fail. We can work around this by providing empty upgrade scripts from these versions to 4.4, which skip the problematic CREATE FUNCTION commands. The functions will be correctly created in the 5.2--5.3 upgrade script.
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||
\echo Use "CREATE EXTENSION repmgr" to load this file. \quit
|
||||
\echo Use "ALTER EXTENSION repmgr UPDATE" to load this file. \quit
|
||||
|
||||
CREATE FUNCTION set_upstream_last_seen()
|
||||
RETURNS VOID
|
||||
AS 'MODULE_PATHNAME', 'set_upstream_last_seen'
|
||||
LANGUAGE C STRICT;
|
||||
-- This script is intentionally empty and exists to skip the CREATE FUNCTION
|
||||
-- commands contained in the 4.2--4.3 and 4.3--4.4 extension upgrade scripts,
|
||||
-- which reference C functions which no longer exist in 5.3 and later.
|
||||
--
|
||||
-- These functions will be explicitly created in the 5.2--5.3 extension
|
||||
-- upgrade step with the correct C function references.
|
||||
|
||||
CREATE FUNCTION get_upstream_last_seen()
|
||||
RETURNS INT
|
||||
AS 'MODULE_PATHNAME', 'get_upstream_last_seen'
|
||||
LANGUAGE C STRICT;
|
||||
|
||||
CREATE FUNCTION get_wal_receiver_pid()
|
||||
RETURNS INT
|
||||
AS 'MODULE_PATHNAME', 'get_wal_receiver_pid'
|
||||
LANGUAGE C STRICT;
|
||||
|
||||
@@ -1,19 +1,9 @@
|
||||
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||
\echo Use "CREATE EXTENSION repmgr" to load this file. \quit
|
||||
\echo Use "ALTER EXTENSION repmgr UPDATE" to load this file. \quit
|
||||
|
||||
DROP FUNCTION set_upstream_last_seen();
|
||||
|
||||
CREATE FUNCTION set_upstream_last_seen(INT)
|
||||
RETURNS VOID
|
||||
AS 'MODULE_PATHNAME', 'set_upstream_last_seen'
|
||||
LANGUAGE C STRICT;
|
||||
|
||||
CREATE FUNCTION get_upstream_node_id()
|
||||
RETURNS INT
|
||||
AS 'MODULE_PATHNAME', 'get_upstream_node_id'
|
||||
LANGUAGE C STRICT;
|
||||
|
||||
CREATE FUNCTION set_upstream_node_id(INT)
|
||||
RETURNS VOID
|
||||
AS 'MODULE_PATHNAME', 'set_upstream_node_id'
|
||||
LANGUAGE C STRICT;
|
||||
-- This script is intentionally empty and exists to skip the CREATE FUNCTION
|
||||
-- commands contained in the 4.3--4.4 extension upgrade script, which reference
|
||||
-- C functions which no longer exist in 5.3 and later.
|
||||
--
|
||||
-- These functions will be explicitly created in the 5.2--5.3 extension
|
||||
-- upgrade step with the correct C function references.
|
||||
|
||||
Reference in New Issue
Block a user