Skip to content

Commit 8a6de8a

Browse files
committed
Fix subscriber to subscription in few places
1 parent 76478c9 commit 8a6de8a

File tree

5 files changed

+30
-31
lines changed

5 files changed

+30
-31
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ Nodes can be added and removed dynamically using the SQL interfaces.
189189
- `subscription_name` - name of the existing subscription
190190
- `relation` - name of existing table, optionally qualified
191191

192-
- `pglogical.alter_subscriber_add_replication_set(subscription_name name,
192+
- `pglogical.alter_subscription_add_replication_set(subscription_name name,
193193
replication_set name)`
194194
Adds one replication set into a subscriber. Does not synchronize, only
195195
activates consumption of events.
@@ -198,7 +198,7 @@ Nodes can be added and removed dynamically using the SQL interfaces.
198198
- `subscription_name` - name of the existing subscription
199199
- `replication_set` - name of replication set to add
200200

201-
- `pglogical.alter_subscriber_remove_replication_set(subscription_name name,
201+
- `pglogical.alter_subscription_remove_replication_set(subscription_name name,
202202
replication_set name)`
203203
Removes one replication set from a subscriber.
204204

expected/add_table.out

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ SELECT * FROM pglogical.show_subscription_table('test_subscription', 'test_publi
219219
public | test_publicschema | syncronized
220220
(1 row)
221221

222-
SELECT * FROM pglogical.alter_subscriber_add_replication_set('test_subscription', 'repset_test');
223-
alter_subscriber_add_replication_set
224-
--------------------------------------
222+
SELECT * FROM pglogical.alter_subscription_add_replication_set('test_subscription', 'repset_test');
223+
alter_subscription_add_replication_set
224+
----------------------------------------
225225
t
226226
(1 row)
227227

228-
SELECT * FROM pglogical.alter_subscriber_remove_replication_set('test_subscription', 'default');
229-
alter_subscriber_remove_replication_set
230-
-----------------------------------------
228+
SELECT * FROM pglogical.alter_subscription_remove_replication_set('test_subscription', 'default');
229+
alter_subscription_remove_replication_set
230+
-------------------------------------------
231231
t
232232
(1 row)
233233

@@ -322,9 +322,9 @@ SELECT * FROM "strange.schema-IS".test_diff_repset;
322322
----+------
323323
(0 rows)
324324

325-
SELECT * FROM pglogical.alter_subscriber_add_replication_set('test_subscription', 'default');
326-
alter_subscriber_add_replication_set
327-
--------------------------------------
325+
SELECT * FROM pglogical.alter_subscription_add_replication_set('test_subscription', 'default');
326+
alter_subscription_add_replication_set
327+
----------------------------------------
328328
t
329329
(1 row)
330330

pglogical--1.0.sql

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,10 @@ RETURNS boolean STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_alte
6161
CREATE FUNCTION pglogical.alter_subscription_enable(subscription_name name, immediate boolean DEFAULT false)
6262
RETURNS boolean STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_alter_subscription_enable';
6363

64-
CREATE FUNCTION pglogical.alter_subscriber_add_replication_set(subscription_name name, replication_set name)
65-
RETURNS boolean STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_alter_subscriber_add_replication_set';
66-
CREATE FUNCTION pglogical.alter_subscriber_remove_replication_set(subscription_name name, replication_set name)
67-
RETURNS boolean STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_alter_subscriber_remove_replication_set';
68-
64+
CREATE FUNCTION pglogical.alter_subscription_add_replication_set(subscription_name name, replication_set name)
65+
RETURNS boolean STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_alter_subscription_add_replication_set';
66+
CREATE FUNCTION pglogical.alter_subscription_remove_replication_set(subscription_name name, replication_set name)
67+
RETURNS boolean STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_alter_subscription_remove_replication_set';
6968

7069
CREATE TABLE pglogical.replication_set (
7170
set_id oid NOT NULL PRIMARY KEY,

pglogical_functions.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ PG_FUNCTION_INFO_V1(pglogical_drop_subscription);
7373
PG_FUNCTION_INFO_V1(pglogical_alter_subscription_disable);
7474
PG_FUNCTION_INFO_V1(pglogical_alter_subscription_enable);
7575

76-
PG_FUNCTION_INFO_V1(pglogical_alter_subscriber_add_replication_set);
77-
PG_FUNCTION_INFO_V1(pglogical_alter_subscriber_remove_replication_set);
76+
PG_FUNCTION_INFO_V1(pglogical_alter_subscription_add_replication_set);
77+
PG_FUNCTION_INFO_V1(pglogical_alter_subscription_remove_replication_set);
7878

7979
PG_FUNCTION_INFO_V1(pglogical_alter_subscription_synchronize);
8080
PG_FUNCTION_INFO_V1(pglogical_alter_subscription_resynchronize_table);
@@ -157,8 +157,8 @@ pglogical_drop_node(PG_FUNCTION_ARGS)
157157
if (list_length(osubs) != 0 || list_length(tsubs) != 0)
158158
ereport(ERROR,
159159
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
160-
errmsg("cannot drop node \"%s\" because it still has subscribers associated with it", node_name),
161-
errhint("drop the subscribers first")));
160+
errmsg("cannot drop node \"%s\" because it still has subscriptions associated with it", node_name),
161+
errhint("drop the subscriptions first")));
162162

163163
/* Drop all the interfaces. */
164164
drop_node_interfaces(node->id);
@@ -385,7 +385,7 @@ pglogical_alter_subscription_disable(PG_FUNCTION_ARGS)
385385
}
386386

387387
/*
388-
* Enable subscriber.
388+
* Enable subscription.
389389
*/
390390
Datum
391391
pglogical_alter_subscription_enable(PG_FUNCTION_ARGS)
@@ -413,10 +413,10 @@ pglogical_alter_subscription_enable(PG_FUNCTION_ARGS)
413413
}
414414

415415
/*
416-
* Add replication set to subscriber.
416+
* Add replication set to subscription.
417417
*/
418418
Datum
419-
pglogical_alter_subscriber_add_replication_set(PG_FUNCTION_ARGS)
419+
pglogical_alter_subscription_add_replication_set(PG_FUNCTION_ARGS)
420420
{
421421
char *sub_name = NameStr(*PG_GETARG_NAME(0));
422422
char *repset_name = NameStr(*PG_GETARG_NAME(1));
@@ -448,10 +448,10 @@ pglogical_alter_subscriber_add_replication_set(PG_FUNCTION_ARGS)
448448
}
449449

450450
/*
451-
* Remove replication set to subscriber.
451+
* Remove replication set to subscription.
452452
*/
453453
Datum
454-
pglogical_alter_subscriber_remove_replication_set(PG_FUNCTION_ARGS)
454+
pglogical_alter_subscription_remove_replication_set(PG_FUNCTION_ARGS)
455455
{
456456
char *sub_name = NameStr(*PG_GETARG_NAME(0));
457457
char *repset_name = NameStr(*PG_GETARG_NAME(1));
@@ -512,7 +512,7 @@ pglogical_alter_subscription_synchronize(PG_FUNCTION_ARGS)
512512
tables = pg_logical_get_remote_repset_tables(conn, sub->replication_sets);
513513
PQfinish(conn);
514514

515-
/* Compare with sync status on subscriber. And add missing ones. */
515+
/* Compare with sync status on subscription. And add missing ones. */
516516
foreach (lc, tables)
517517
{
518518
RangeVar *rv = (RangeVar *) lfirst(lc);
@@ -1192,7 +1192,7 @@ pglogical_node_info(PG_FUNCTION_ARGS)
11921192
Datum
11931193
pglogical_gen_slot_name(PG_FUNCTION_ARGS)
11941194
{
1195-
char *subscriber_name = NameStr(*PG_GETARG_NAME(0));
1195+
char *subscription_name = NameStr(*PG_GETARG_NAME(0));
11961196
Name slot_name;
11971197
PGLogicalLocalNode *node;
11981198

@@ -1205,7 +1205,7 @@ pglogical_gen_slot_name(PG_FUNCTION_ARGS)
12051205
"pgl_%s_%s_%s",
12061206
shorten_hash(get_database_name(MyDatabaseId), 16),
12071207
shorten_hash(node->node->name, 16),
1208-
shorten_hash(subscriber_name, 16));
1208+
shorten_hash(subscription_name, 16));
12091209
NameStr(*slot_name)[NAMEDATALEN-1] = '\0';
12101210

12111211
PG_RETURN_NAME(slot_name);

sql/add_table.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ SELECT * FROM public.test_publicschema;
106106

107107
SELECT * FROM pglogical.show_subscription_table('test_subscription', 'test_publicschema');
108108

109-
SELECT * FROM pglogical.alter_subscriber_add_replication_set('test_subscription', 'repset_test');
110-
SELECT * FROM pglogical.alter_subscriber_remove_replication_set('test_subscription', 'default');
109+
SELECT * FROM pglogical.alter_subscription_add_replication_set('test_subscription', 'repset_test');
110+
SELECT * FROM pglogical.alter_subscription_remove_replication_set('test_subscription', 'default');
111111

112112
\c regression
113113

@@ -169,7 +169,7 @@ TRUNCATE "strange.schema-IS".test_diff_repset;
169169

170170
SELECT * FROM "strange.schema-IS".test_diff_repset;
171171

172-
SELECT * FROM pglogical.alter_subscriber_add_replication_set('test_subscription', 'default');
172+
SELECT * FROM pglogical.alter_subscription_add_replication_set('test_subscription', 'default');
173173

174174
\c regression
175175

0 commit comments

Comments
 (0)