Skip to content

Commit 912e1cf

Browse files
Merging tests
Merging tests for foreign keys and functions.
1 parent 0ad774b commit 912e1cf

File tree

5 files changed

+680
-1
lines changed

5 files changed

+680
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SCRIPTS_built = pglogical_create_subscriber
1818
PG_CPPFLAGS = -I$(libpq_srcdir)
1919
SHLIB_LINK = $(libpq)
2020

21-
REGRESS = init basic extended toasted replication_set add_table matview bidirectional drop
21+
REGRESS = init basic extended toasted replication_set add_table matview bidirectional foreign_key functions drop
2222

2323
ifdef PG94
2424
PG_CPPFLAGS += -Icompat

expected/foreign_key.out

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
--FOREIGN KEY
2+
\c regression
3+
SELECT pglogical.replicate_ddl_command($$
4+
CREATE TABLE public.f1k_products (
5+
product_no integer PRIMARY KEY,
6+
product_id integer,
7+
name text,
8+
price numeric
9+
);
10+
11+
CREATE TABLE public.f1k_orders (
12+
order_id integer,
13+
product_no integer REFERENCES public.f1k_products (product_no),
14+
quantity integer
15+
);
16+
--pass
17+
$$);
18+
replicate_ddl_command
19+
-----------------------
20+
t
21+
(1 row)
22+
23+
SELECT pg_xlog_wait_remote_apply(pg_current_xlog_location(), pid) FROM pg_stat_replication;
24+
pg_xlog_wait_remote_apply
25+
---------------------------
26+
27+
(1 row)
28+
29+
INSERT into public.f1k_products VALUES (1, 1, 'product1', 1.20);
30+
INSERT into public.f1k_products VALUES (2, 2, 'product2', 2.40);
31+
INSERT into public.f1k_orders VALUES (300, 1, 4);
32+
INSERT into public.f1k_orders VALUES (22, 2, 14);
33+
INSERT into public.f1k_orders VALUES (23, 2, 24);
34+
INSERT into public.f1k_orders VALUES (24, 2, 40);
35+
SELECT pg_xlog_wait_remote_apply(pg_current_xlog_location(), pid) FROM pg_stat_replication;
36+
pg_xlog_wait_remote_apply
37+
---------------------------
38+
39+
(1 row)
40+
41+
\c postgres
42+
SELECT * FROM public.f1k_products;
43+
product_no | product_id | name | price
44+
------------+------------+----------+-------
45+
1 | 1 | product1 | 1.20
46+
2 | 2 | product2 | 2.40
47+
(2 rows)
48+
49+
SELECT * FROM public.f1k_orders;
50+
order_id | product_no | quantity
51+
----------+------------+----------
52+
300 | 1 | 4
53+
22 | 2 | 14
54+
23 | 2 | 24
55+
24 | 2 | 40
56+
(4 rows)
57+
58+
\c regression
59+
SELECT pglogical.replicate_ddl_command($$
60+
DROP TABLE public.f1k_orders;
61+
DROP TABLE public.f1k_products;
62+
$$);
63+
replicate_ddl_command
64+
-----------------------
65+
t
66+
(1 row)
67+

0 commit comments

Comments
 (0)