Skip to content

Commit c4c6949

Browse files
committed
Merge branch 'master' into REL1_0_STABLE
2 parents 92e1c23 + 86f1ede commit c4c6949

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+440
-762
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ The following functions are provided for managing the replication sets:
270270
- `replicate_delete` - specifies if `DELETE` is replicated, default true
271271
- `replicate_truncate` - specifies if `TRUNCATE` is replicated, default true
272272

273-
- `pglogical.delete_replication_set(set_name text)`
273+
- `pglogical.drop_replication_set(set_name text)`
274274
Removes the replication set.
275275

276276
Parameters:

expected/add_table.out

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
/* First test whether a table's replication set can be properly manipulated */
2-
SELECT * FROM pglogical_regress_variables();
3-
provider_dsn | subscriber_dsn
4-
--------------+----------------
5-
regression | postgres
6-
(1 row)
7-
2+
SELECT * FROM pglogical_regress_variables()
83
\gset
94
\c :provider_dsn
105
SELECT pglogical.replicate_ddl_command($$
@@ -346,43 +341,16 @@ BEGIN
346341
END LOOP;
347342
END;
348343
$$;
344+
\set VERBOSITY terse
349345
SELECT pglogical.replicate_ddl_command($$
350346
DROP TABLE public.test_publicschema CASCADE;
351347
DROP TABLE public.test_nosync CASCADE;
352348
DROP SCHEMA "strange.schema-IS" CASCADE;
353349
$$);
354350
NOTICE: drop cascades to 2 other objects
355-
DETAIL: table public.test_publicschema in replication set repset_test
356-
table public.test_publicschema in replication set default
357-
CONTEXT: during execution of queued SQL statement:
358-
DROP TABLE public.test_publicschema CASCADE;
359-
DROP TABLE public.test_nosync CASCADE;
360-
DROP SCHEMA "strange.schema-IS" CASCADE;
361-
362351
NOTICE: drop cascades to 2 other objects
363-
DETAIL: table public.test_nosync in replication set repset_test
364-
table public.test_nosync in replication set default
365-
CONTEXT: during execution of queued SQL statement:
366-
DROP TABLE public.test_publicschema CASCADE;
367-
DROP TABLE public.test_nosync CASCADE;
368-
DROP SCHEMA "strange.schema-IS" CASCADE;
369-
370352
NOTICE: drop cascades to 2 other objects
371-
DETAIL: drop cascades to table "strange.schema-IS".test_strangeschema
372-
drop cascades to table "strange.schema-IS".test_diff_repset
373-
CONTEXT: during execution of queued SQL statement:
374-
DROP TABLE public.test_publicschema CASCADE;
375-
DROP TABLE public.test_nosync CASCADE;
376-
DROP SCHEMA "strange.schema-IS" CASCADE;
377-
378353
NOTICE: drop cascades to 2 other objects
379-
DETAIL: table strange.schema-IS.test_strangeschema in replication set default
380-
table strange.schema-IS.test_diff_repset in replication set repset_test
381-
CONTEXT: during execution of queued SQL statement:
382-
DROP TABLE public.test_publicschema CASCADE;
383-
DROP TABLE public.test_nosync CASCADE;
384-
DROP SCHEMA "strange.schema-IS" CASCADE;
385-
386354
replicate_ddl_command
387355
-----------------------
388356
t

expected/basic.out

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
-- basic builtin datatypes
2-
SELECT * FROM pglogical_regress_variables();
3-
provider_dsn | subscriber_dsn
4-
--------------+----------------
5-
regression | postgres
6-
(1 row)
7-
2+
SELECT * FROM pglogical_regress_variables()
83
\gset
94
\c :provider_dsn
105
SELECT pglogical.replicate_ddl_command($$
@@ -191,14 +186,11 @@ SELECT id, other, data, something FROM basic_dml ORDER BY id;
191186
(4 rows)
192187

193188
\c :provider_dsn
189+
\set VERBOSITY terse
194190
SELECT pglogical.replicate_ddl_command($$
195191
DROP TABLE public.basic_dml CASCADE;
196192
$$);
197193
NOTICE: drop cascades to 1 other object
198-
DETAIL: table public.basic_dml in replication set default
199-
CONTEXT: during execution of queued SQL statement:
200-
DROP TABLE public.basic_dml CASCADE;
201-
202194
replicate_ddl_command
203195
-----------------------
204196
t

expected/bidirectional.out

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
SELECT * FROM pglogical_regress_variables();
2-
provider_dsn | subscriber_dsn
3-
--------------+----------------
4-
regression | postgres
5-
(1 row)
6-
1+
SELECT * FROM pglogical_regress_variables()
72
\gset
83
\c :provider_dsn
4+
DO $$
5+
BEGIN
6+
IF (SELECT setting::integer/100 FROM pg_settings WHERE name = 'server_version_num') = 904 THEN
7+
CREATE EXTENSION IF NOT EXISTS pglogical_origin;
8+
END IF;
9+
END;$$;
910
SELECT * FROM pglogical.create_subscription(
1011
subscription_name := 'test_bidirectional',
11-
provider_dsn := 'dbname=postgres user=super',
12+
provider_dsn := (SELECT subscriber_dsn FROM pglogical_regress_variables()) || ' user=super',
1213
synchronize_structure := false,
1314
synchronize_data := false,
1415
forward_origins := '{}');
@@ -103,14 +104,11 @@ SELECT id, other, data, something FROM basic_dml ORDER BY id;
103104
(5 rows)
104105

105106
\c :provider_dsn
107+
\set VERBOSITY terse
106108
SELECT pglogical.replicate_ddl_command($$
107109
DROP TABLE public.basic_dml CASCADE;
108110
$$);
109111
NOTICE: drop cascades to 1 other object
110-
DETAIL: table public.basic_dml in replication set default
111-
CONTEXT: during execution of queued SQL statement:
112-
DROP TABLE public.basic_dml CASCADE;
113-
114112
replicate_ddl_command
115113
-----------------------
116114
t
@@ -122,16 +120,14 @@ SELECT pglogical.drop_subscription('test_bidirectional');
122120
1
123121
(1 row)
124122

123+
SET client_min_messages = 'warning';
124+
DROP EXTENSION IF EXISTS pglogical_origin;
125125
\c :subscriber_dsn
126-
SELECT count(1) FROM pg_stat_replication;
127-
count
128-
-------
129-
1
126+
\a
127+
SELECT slot_name FROM pg_replication_slots WHERE database = current_database();
128+
slot_name
129+
(0 rows)
130+
SELECT count(*) FROM pg_stat_replication WHERE application_name = 'test_bidirectional';
131+
count
132+
0
130133
(1 row)
131-
132-
SELECT slot_name FROM pg_replication_slots;
133-
slot_name
134-
--------------------------------------------
135-
pgl_postgres_test_provider_test_sube55bf37
136-
(1 row)
137-

expected/copy.out

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
--test COPY
2-
SELECT * FROM pglogical_regress_variables();
3-
provider_dsn | subscriber_dsn
4-
--------------+----------------
5-
regression | postgres
6-
(1 row)
7-
2+
SELECT * FROM pglogical_regress_variables()
83
\gset
94
\c :provider_dsn
105
SELECT pglogical.replicate_ddl_command($$

expected/drop.out

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
SELECT * FROM pglogical_regress_variables();
2-
provider_dsn | subscriber_dsn
3-
--------------+----------------
4-
regression | postgres
5-
(1 row)
6-
1+
SELECT * FROM pglogical_regress_variables()
72
\gset
83
\c :provider_dsn
94
SELECT * FROM pglogical.drop_node(node_name := 'test_provider');
105
ERROR: cannot drop node "test_provider" because replication slot "pgl_postgres_test_provider_test_sube55bf37" on the node is still active
116
HINT: drop the subscriptions first
12-
SELECT slot_name, plugin, slot_type, database, active FROM pg_replication_slots;
13-
slot_name | plugin | slot_type | database | active
14-
--------------------------------------------+------------------+-----------+------------+--------
15-
pgl_postgres_test_provider_test_sube55bf37 | pglogical_output | logical | regression | t
7+
SELECT plugin, slot_type, active FROM pg_replication_slots;
8+
plugin | slot_type | active
9+
------------------+-----------+--------
10+
pglogical_output | logical | t
1611
(1 row)
1712

1813
SELECT count(*) FROM pg_stat_replication;
@@ -41,9 +36,9 @@ SELECT * FROM pglogical.drop_node(node_name := 'test_provider');
4136
t
4237
(1 row)
4338

44-
SELECT slot_name, plugin, slot_type, database, active FROM pg_replication_slots;
45-
slot_name | plugin | slot_type | database | active
46-
-----------+--------+-----------+----------+--------
39+
SELECT plugin, slot_type, active FROM pg_replication_slots;
40+
plugin | slot_type | active
41+
--------+-----------+--------
4742
(0 rows)
4843

4944
SELECT count(*) FROM pg_stat_replication;

0 commit comments

Comments
 (0)