Skip to content

Commit bffe62e

Browse files
committed
Fix extension upgrade script
1 parent 91a6d84 commit bffe62e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pglogical--1.0.0--1.0.1.sql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ CREATE OR REPLACE FUNCTION pglogical.create_subscription(subscription_name name,
33
synchronize_data boolean = true, forward_origins text[] = '{all}')
44
RETURNS oid STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_create_subscription';
55

6-
SELECT * FROM pglogical.create_replication_set('ddl_sql', true, false, false, false);
6+
DO $$
7+
BEGIN
8+
IF (SELECT count(1) FROM pglogical.nodes) > 0 THEN
9+
SELECT * FROM pglogical.create_replication_set('ddl_sql', true, false, false, false);
10+
END IF;
11+
END; $$;
712

813
UPDATE pglogical.subscription SET sub_replication_sets = array_append(sub_replication_sets, 'ddl_sql');
914

0 commit comments

Comments
 (0)