Skip to content

Commit 0760415

Browse files
committed
Whitespace cleanup
1 parent 36ecd15 commit 0760415

File tree

2 files changed

+63
-63
lines changed

2 files changed

+63
-63
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Now create the provider node:
8383

8484
Add all tables in `public` schema to the `default` replication set.
8585

86-
SELECT pglogical.replication_set_add_all_tables('default', ARRAY['public']);
86+
SELECT pglogical.replication_set_add_all_tables('default', ARRAY['public']);
8787

8888
Optionally you can also create additional replication sets and add tables to
8989
them (see [Replication sets](#replication-sets)). It's usually better to create

pglogical--1.0.sql

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
CREATE TABLE pglogical.node (
2-
node_id oid NOT NULL PRIMARY KEY,
3-
node_name name NOT NULL UNIQUE
2+
node_id oid NOT NULL PRIMARY KEY,
3+
node_name name NOT NULL UNIQUE
44
) WITH (user_catalog_table=true);
55

66
CREATE TABLE pglogical.node_interface (
7-
if_id oid NOT NULL PRIMARY KEY,
8-
if_name name NOT NULL, -- default same as node name
9-
if_nodeid oid REFERENCES node(node_id),
10-
if_dsn text NOT NULL,
11-
UNIQUE (if_nodeid, if_name)
7+
if_id oid NOT NULL PRIMARY KEY,
8+
if_name name NOT NULL, -- default same as node name
9+
if_nodeid oid REFERENCES node(node_id),
10+
if_dsn text NOT NULL,
11+
UNIQUE (if_nodeid, if_name)
1212
);
1313

1414
CREATE TABLE pglogical.local_node (
15-
node_id oid PRIMARY KEY REFERENCES node(node_id),
16-
node_local_interface oid NOT NULL REFERENCES node_interface(if_id)
15+
node_id oid PRIMARY KEY REFERENCES node(node_id),
16+
node_local_interface oid NOT NULL REFERENCES node_interface(if_id)
1717
);
1818

1919
-- Currently we allow only one node record per database
2020
CREATE UNIQUE INDEX local_node_onlyone ON pglogical.local_node ((true));
2121

2222
CREATE TABLE pglogical.subscription (
23-
sub_id oid NOT NULL PRIMARY KEY,
24-
sub_name name NOT NULL UNIQUE,
25-
sub_origin oid NOT NULL REFERENCES node(node_id),
26-
sub_target oid NOT NULL REFERENCES node(node_id),
23+
sub_id oid NOT NULL PRIMARY KEY,
24+
sub_name name NOT NULL UNIQUE,
25+
sub_origin oid NOT NULL REFERENCES node(node_id),
26+
sub_target oid NOT NULL REFERENCES node(node_id),
2727
sub_origin_if oid NOT NULL REFERENCES node_interface(if_id),
28-
sub_target_if oid NOT NULL REFERENCES node_interface(if_id),
29-
sub_enabled boolean NOT NULL DEFAULT true,
30-
sub_slot_name name NOT NULL,
31-
sub_replication_sets text[],
32-
sub_forward_origins text[],
33-
UNIQUE (sub_origin, sub_target)
28+
sub_target_if oid NOT NULL REFERENCES node_interface(if_id),
29+
sub_enabled boolean NOT NULL DEFAULT true,
30+
sub_slot_name name NOT NULL,
31+
sub_replication_sets text[],
32+
sub_forward_origins text[],
33+
UNIQUE (sub_origin, sub_target)
3434
);
3535

3636
CREATE TABLE pglogical.local_sync_status (
37-
sync_kind "char" NOT NULL CHECK (sync_kind IN ('i', 's', 'd', 'f')),
38-
sync_subid oid NOT NULL REFERENCES pglogical.subscription(sub_id),
39-
sync_nspname name,
40-
sync_relname name,
41-
sync_status "char" NOT NULL,
42-
UNIQUE (sync_subid, sync_nspname, sync_relname)
37+
sync_kind "char" NOT NULL CHECK (sync_kind IN ('i', 's', 'd', 'f')),
38+
sync_subid oid NOT NULL REFERENCES pglogical.subscription(sub_id),
39+
sync_nspname name,
40+
sync_relname name,
41+
sync_status "char" NOT NULL,
42+
UNIQUE (sync_subid, sync_nspname, sync_relname)
4343
);
4444

4545

@@ -49,8 +49,8 @@ CREATE FUNCTION pglogical.drop_node(node_name name, ifexists boolean DEFAULT fal
4949
RETURNS boolean STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_drop_node';
5050

5151
CREATE FUNCTION pglogical.create_subscription(subscription_name name, provider_dsn text,
52-
replication_sets text[] = '{default,default_insert_only}', synchronize_structure boolean = true,
53-
synchronize_data boolean = true, forward_origins text[] = '{all}')
52+
replication_sets text[] = '{default,default_insert_only}', synchronize_structure boolean = true,
53+
synchronize_data boolean = true, forward_origins text[] = '{all}')
5454
RETURNS oid STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_create_subscription';
5555
CREATE FUNCTION pglogical.drop_subscription(subscription_name name, ifexists boolean DEFAULT false)
5656
RETURNS oid STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_drop_subscription';
@@ -66,67 +66,67 @@ CREATE FUNCTION pglogical.alter_subscription_remove_replication_set(subscription
6666
RETURNS boolean STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_alter_subscription_remove_replication_set';
6767

6868
CREATE FUNCTION pglogical.show_subscription_status(subscription_name name DEFAULT NULL,
69-
OUT subscription_name text, OUT status text, OUT provider_node text,
70-
OUT provider_dsn text, OUT slot_name text, OUT replication_sets text[],
71-
OUT forward_origins text[])
69+
OUT subscription_name text, OUT status text, OUT provider_node text,
70+
OUT provider_dsn text, OUT slot_name text, OUT replication_sets text[],
71+
OUT forward_origins text[])
7272
RETURNS SETOF record STABLE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_show_subscription_status';
7373

7474
CREATE TABLE pglogical.replication_set (
75-
set_id oid NOT NULL PRIMARY KEY,
76-
set_nodeid oid NOT NULL,
75+
set_id oid NOT NULL PRIMARY KEY,
76+
set_nodeid oid NOT NULL,
7777
set_name name NOT NULL,
7878
replicate_insert boolean NOT NULL DEFAULT true,
7979
replicate_update boolean NOT NULL DEFAULT true,
8080
replicate_delete boolean NOT NULL DEFAULT true,
8181
replicate_truncate boolean NOT NULL DEFAULT true,
82-
UNIQUE (set_nodeid, set_name)
82+
UNIQUE (set_nodeid, set_name)
8383
) WITH (user_catalog_table=true);
8484

8585
CREATE TABLE pglogical.replication_set_table (
8686
set_id integer NOT NULL,
87-
set_reloid regclass NOT NULL,
88-
PRIMARY KEY(set_id, set_reloid)
87+
set_reloid regclass NOT NULL,
88+
PRIMARY KEY(set_id, set_reloid)
8989
) WITH (user_catalog_table=true);
9090

9191
CREATE VIEW pglogical.TABLES AS
92-
WITH set_tables AS (
93-
SELECT s.set_name, t.set_reloid
94-
FROM pglogical.replication_set_table t,
95-
pglogical.replication_set s,
92+
WITH set_tables AS (
93+
SELECT s.set_name, t.set_reloid
94+
FROM pglogical.replication_set_table t,
95+
pglogical.replication_set s,
9696
pglogical.local_node n
97-
WHERE s.set_nodeid = n.node_id
98-
AND s.set_id = t.set_id
97+
WHERE s.set_nodeid = n.node_id
98+
AND s.set_id = t.set_id
9999
),
100-
user_tables AS (
101-
SELECT r.oid, n.nspname, r.relname, r.relreplident
102-
FROM pg_catalog.pg_class r,
103-
pg_catalog.pg_namespace n
104-
WHERE r.relkind = 'r'
100+
user_tables AS (
101+
SELECT r.oid, n.nspname, r.relname, r.relreplident
102+
FROM pg_catalog.pg_class r,
103+
pg_catalog.pg_namespace n
104+
WHERE r.relkind = 'r'
105105
AND r.relpersistence = 'p'
106-
AND n.oid = r.relnamespace
107-
AND n.nspname !~ '^pg_'
108-
AND n.nspname != 'information_schema'
109-
AND n.nspname != 'pglogical'
110-
)
106+
AND n.oid = r.relnamespace
107+
AND n.nspname !~ '^pg_'
108+
AND n.nspname != 'information_schema'
109+
AND n.nspname != 'pglogical'
110+
)
111111
SELECT n.nspname, r.relname, s.set_name
112-
FROM pg_catalog.pg_namespace n,
113-
pg_catalog.pg_class r,
114-
set_tables s
112+
FROM pg_catalog.pg_namespace n,
113+
pg_catalog.pg_class r,
114+
set_tables s
115115
WHERE r.relkind = 'r'
116-
AND n.oid = r.relnamespace
117-
AND r.oid = s.set_reloid
118-
UNION
116+
AND n.oid = r.relnamespace
117+
AND r.oid = s.set_reloid
118+
UNION
119119
SELECT t.nspname, t.relname, NULL
120-
FROM user_tables t
120+
FROM user_tables t
121121
WHERE t.oid NOT IN (SELECT set_reloid FROM set_tables);
122122

123123
CREATE FUNCTION pglogical.create_replication_set(set_name name,
124-
replicate_insert boolean = true, replicate_update boolean = true,
125-
replicate_delete boolean = true, replicate_truncate boolean = true)
124+
replicate_insert boolean = true, replicate_update boolean = true,
125+
replicate_delete boolean = true, replicate_truncate boolean = true)
126126
RETURNS oid STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_create_replication_set';
127127
CREATE FUNCTION pglogical.alter_replication_set(set_name name,
128-
replicate_insert boolean DEFAULT NULL, replicate_update boolean DEFAULT NULL,
129-
replicate_delete boolean DEFAULT NULL, replicate_truncate boolean DEFAULT NULL)
128+
replicate_insert boolean DEFAULT NULL, replicate_update boolean DEFAULT NULL,
129+
replicate_delete boolean DEFAULT NULL, replicate_truncate boolean DEFAULT NULL)
130130
RETURNS oid CALLED ON NULL INPUT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_alter_replication_set';
131131
CREATE FUNCTION pglogical.drop_replication_set(set_name name, ifexists boolean DEFAULT false)
132132
RETURNS boolean STRICT VOLATILE LANGUAGE c AS 'MODULE_PATHNAME', 'pglogical_drop_replication_set';

0 commit comments

Comments
 (0)