upgrade script pglogical--2.2.2--2.3.1.sql is not correct
pglogical_create_subscription has 7 args in 2.* and 8 args in 3.*, but the upgrade script does not change the function.
btw the following is the gemini auto-generated script
-- Upgrade script for pglogical from version 2.2.2 to 2.3.1
-- 1. Add the 'sub_force_text_transfer' column to the 'pglogical.subscription' table.
-- This column is new in version 2.3.1 and controls whether to use text or binary transfer.
ALTER TABLE pglogical.subscription
ADD COLUMN sub_force_text_transfer boolean NOT NULL DEFAULT 'f';
-- 2. Update the 'create_subscription' function to include the new 'force_text_transfer' parameter.
-- To do this, we must first drop the old function from version 2.2.2 because the
-- function signature has changed.
DROP FUNCTION pglogical.create_subscription(subscription_name name, provider_dsn text,
replication_sets text[], synchronize_structure boolean,
synchronize_data boolean, forward_origins text[], apply_delay interval);
-- Now, create the new 'create_subscription' function with the added
-- 'force_text_transfer' parameter, as defined in version 2.3.1.
CREATE FUNCTION pglogical.create_subscription(subscription_name name, provider_dsn text,
replication_sets text[] = '{default,default_insert_only,ddl_sql}', synchronize_structure boolean = false,
synchronize_data boolean = true, forward_origins text[] = '{all}', apply_delay interval DEFAULT '0',
force_text_transfer boolean = false)
RETURNS oid STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_create_subscription';
Could you provide the output of the following extension commands showing the issue?
SET log_min_messages TO debug1;
CREATE EXTENSION pglogical VERSION '2.2.0';
ALTER EXTENSION pglogical UPDATE TO '2.4.5';
The debug messages will say the script that were applied. In this example it should be:
postgres=# SET log_min_messages TO debug1;
SET
postgres=# CREATE EXTENSION pglogical VERSION '2.2.0';
2025-08-23 14:02:06.777 -03 [15216] DEBUG: executing extension script for "pglogical" version '2.2.0'
CREATE EXTENSION
postgres=# ALTER EXTENSION pglogical UPDATE TO '2.4.5';
2025-08-23 14:02:13.932 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.2.0' to '2.2.1'
2025-08-23 14:02:13.934 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.2.1' to '2.2.2'
2025-08-23 14:02:13.934 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.2.2' to '2.3.1'
2025-08-23 14:02:13.937 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.3.1' to '2.3.2'
2025-08-23 14:02:13.938 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.3.2' to '2.3.3'
2025-08-23 14:02:13.938 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.3.3' to '2.3.4'
2025-08-23 14:02:13.938 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.3.4' to '2.4.0'
2025-08-23 14:02:13.938 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.4.0' to '2.4.1'
2025-08-23 14:02:13.938 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.4.1' to '2.4.2'
2025-08-23 14:02:13.939 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.4.2' to '2.4.3'
2025-08-23 14:02:13.939 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.4.3' to '2.4.4'
2025-08-23 14:02:13.939 -03 [15216] DEBUG: executing extension script for "pglogical" update from version '2.4.4' to '2.4.5'
ALTER EXTENSION
You notice that it jumps 2.3.0. That is not an oversight. That's because this version (2.3.0) included 2 features that were reverted in 2.3.1. See the release notes. That's why there is no 2.2.2 to 2.3.0 path. The difference you are noticing between 2.2.2--2.3.0 to 2.2.2--2.3.1 is correct.
https://github.com/2ndQuadrant/pglogical/blob/51a9344215ae756d6165f0bc1e5cb40289f806c6/sql/init_fail.sql#L35-L39
# SELECT * FROM pg_extension_update_paths('pglogical') where source = '1.0.0' and target = '2.4.5'; and it involves a 2.2.2--2.3.1
even though the upgrade is successful, if you check the function signature, you will find create_subscription problematic.
i find the issue when running regression test w/ asan (valgrind instrumentation replaced), but you should be able to repro w/ valgrind.