@@ -5,15 +5,20 @@ CREATE ROLE regress_publication_user LOGIN SUPERUSER;
5
5
CREATE ROLE regress_publication_user2;
6
6
CREATE ROLE regress_publication_user_dummy LOGIN NOSUPERUSER;
7
7
SET SESSION AUTHORIZATION 'regress_publication_user';
8
+ -- suppress warning that depends on wal_level
9
+ SET client_min_messages = 'ERROR';
8
10
CREATE PUBLICATION testpub_default;
11
+ RESET client_min_messages;
9
12
COMMENT ON PUBLICATION testpub_default IS 'test publication';
10
13
SELECT obj_description(p.oid, 'pg_publication') FROM pg_publication p;
11
14
obj_description
12
15
------------------
13
16
test publication
14
17
(1 row)
15
18
19
+ SET client_min_messages = 'ERROR';
16
20
CREATE PUBLICATION testpib_ins_trunct WITH (publish = insert);
21
+ RESET client_min_messages;
17
22
ALTER PUBLICATION testpub_default SET (publish = update);
18
23
-- error cases
19
24
CREATE PUBLICATION testpub_xxx WITH (foo);
@@ -43,7 +48,9 @@ CREATE TABLE testpub_tbl1 (id serial primary key, data text);
43
48
CREATE TABLE pub_test.testpub_nopk (foo int, bar int);
44
49
CREATE VIEW testpub_view AS SELECT 1;
45
50
CREATE TABLE testpub_parted (a int) PARTITION BY LIST (a);
51
+ SET client_min_messages = 'ERROR';
46
52
CREATE PUBLICATION testpub_foralltables FOR ALL TABLES WITH (publish = 'insert');
53
+ RESET client_min_messages;
47
54
ALTER PUBLICATION testpub_foralltables SET (publish = 'insert, update');
48
55
CREATE TABLE testpub_tbl2 (id serial primary key, data text);
49
56
-- fail - can't add to for all tables publication
@@ -86,8 +93,10 @@ DROP TABLE testpub_tbl2;
86
93
DROP PUBLICATION testpub_foralltables;
87
94
CREATE TABLE testpub_tbl3 (a int);
88
95
CREATE TABLE testpub_tbl3a (b text) INHERITS (testpub_tbl3);
96
+ SET client_min_messages = 'ERROR';
89
97
CREATE PUBLICATION testpub3 FOR TABLE testpub_tbl3;
90
98
CREATE PUBLICATION testpub4 FOR TABLE ONLY testpub_tbl3;
99
+ RESET client_min_messages;
91
100
\dRp+ testpub3
92
101
Publication testpub3
93
102
Owner | All tables | Inserts | Updates | Deletes | Truncates
@@ -111,7 +120,9 @@ DROP PUBLICATION testpub3, testpub4;
111
120
CREATE PUBLICATION testpub_fortbl FOR TABLE testpub_view;
112
121
ERROR: "testpub_view" is not a table
113
122
DETAIL: Only tables can be added to publications.
123
+ SET client_min_messages = 'ERROR';
114
124
CREATE PUBLICATION testpub_fortbl FOR TABLE testpub_tbl1, pub_test.testpub_nopk;
125
+ RESET client_min_messages;
115
126
-- fail - already added
116
127
ALTER PUBLICATION testpub_fortbl ADD TABLE testpub_tbl1;
117
128
ERROR: relation "testpub_tbl1" is already member of publication "testpub_fortbl"
@@ -196,7 +207,9 @@ ERROR: permission denied for database regression
196
207
SET ROLE regress_publication_user;
197
208
GRANT CREATE ON DATABASE regression TO regress_publication_user2;
198
209
SET ROLE regress_publication_user2;
210
+ SET client_min_messages = 'ERROR';
199
211
CREATE PUBLICATION testpub2; -- ok
212
+ RESET client_min_messages;
200
213
ALTER PUBLICATION testpub2 ADD TABLE testpub_tbl1; -- fail
201
214
ERROR: must be owner of table testpub_tbl1
202
215
SET ROLE regress_publication_user;
0 commit comments