11select 1 from pg_create_logical_replication_slot('realtime', 'wal2json', false);
2- ?column?
2+ ?column?
33----------
44 1
55(1 row)
1919 ),
2020 array[('page_id', 'eq', '5', null)::realtime.user_defined_filter];
2121select clear_wal();
22- clear_wal
22+ clear_wal
2323-----------
24-
24+
2525(1 row)
2626
2727-- Expect 0 subscriptions: filters do not match: 5 <> 1
@@ -33,28 +33,28 @@ select
3333 errors
3434from
3535 walrus;
36- rec | is_rls_enabled | subscription_ids | errors
36+ rec | is_rls_enabled | subscription_ids | errors
3737----------------------------------------------------+----------------+------------------+--------
3838 { +| f | {} | {}
39- "type": "INSERT", +| | |
40- "table": "notes", +| | |
41- "record": { +| | |
42- "id": 1, +| | |
43- "page_id": 1 +| | |
44- }, +| | |
45- "schema": "public", +| | |
46- "columns": [ +| | |
47- { +| | |
48- "name": "id", +| | |
49- "type": "int4" +| | |
50- }, +| | |
51- { +| | |
52- "name": "page_id", +| | |
53- "type": "int4" +| | |
54- } +| | |
55- ], +| | |
56- "commit_timestamp": "2000-01-01T08:01:01.000Z"+| | |
57- } | | |
39+ "type": "INSERT", +| | |
40+ "table": "notes", +| | |
41+ "record": { +| | |
42+ "id": 1, +| | |
43+ "page_id": 1 +| | |
44+ }, +| | |
45+ "schema": "public", +| | |
46+ "columns": [ +| | |
47+ { +| | |
48+ "name": "id", +| | |
49+ "type": "int4" +| | |
50+ }, +| | |
51+ { +| | |
52+ "name": "page_id", +| | |
53+ "type": "int4" +| | |
54+ } +| | |
55+ ], +| | |
56+ "commit_timestamp": "2000-01-01T08:01:01.000Z"+| | |
57+ } | | |
5858(1 row)
5959
6060-- Expect 1 subscription: filters do match 5 = 5
@@ -66,28 +66,28 @@ select
6666 errors
6767from
6868 walrus;
69- rec | is_rls_enabled | subscription_ids | errors
69+ rec | is_rls_enabled | subscription_ids | errors
7070----------------------------------------------------+----------------+----------------------------------------+--------
7171 { +| f | {f4539ebe-c779-5788-bbc1-2421ffaa8954} | {}
72- "type": "INSERT", +| | |
73- "table": "notes", +| | |
74- "record": { +| | |
75- "id": 2, +| | |
76- "page_id": 5 +| | |
77- }, +| | |
78- "schema": "public", +| | |
79- "columns": [ +| | |
80- { +| | |
81- "name": "id", +| | |
82- "type": "int4" +| | |
83- }, +| | |
84- { +| | |
85- "name": "page_id", +| | |
86- "type": "int4" +| | |
87- } +| | |
88- ], +| | |
89- "commit_timestamp": "2000-01-01T08:01:01.000Z"+| | |
90- } | | |
72+ "type": "INSERT", +| | |
73+ "table": "notes", +| | |
74+ "record": { +| | |
75+ "id": 2, +| | |
76+ "page_id": 5 +| | |
77+ }, +| | |
78+ "schema": "public", +| | |
79+ "columns": [ +| | |
80+ { +| | |
81+ "name": "id", +| | |
82+ "type": "int4" +| | |
83+ }, +| | |
84+ { +| | |
85+ "name": "page_id", +| | |
86+ "type": "int4" +| | |
87+ } +| | |
88+ ], +| | |
89+ "commit_timestamp": "2000-01-01T08:01:01.000Z"+| | |
90+ } | | |
9191(1 row)
9292
9393-- Expect 0 subscriptions: filters do match 5 <> null
@@ -99,35 +99,35 @@ select
9999 errors
100100from
101101 walrus;
102- rec | is_rls_enabled | subscription_ids | errors
103- ----------------------------------------------------+----------------+---------------------------------------- +--------
104- { +| f | {f4539ebe-c779-5788-bbc1-2421ffaa8954} | {}
105- "type": "INSERT", +| | |
106- "table": "notes", +| | |
107- "record": { +| | |
108- "id": 3, +| | |
109- "page_id": null +| | |
110- }, +| | |
111- "schema": "public", +| | |
112- "columns": [ +| | |
113- { +| | |
114- "name": "id", +| | |
115- "type": "int4" +| | |
116- }, +| | |
117- { +| | |
118- "name": "page_id", +| | |
119- "type": "int4" +| | |
120- } +| | |
121- ], +| | |
122- "commit_timestamp": "2000-01-01T08:01:01.000Z"+| | |
123- } | | |
102+ rec | is_rls_enabled | subscription_ids | errors
103+ ----------------------------------------------------+----------------+------------------+--------
104+ { +| f | {} | {}
105+ "type": "INSERT", +| | |
106+ "table": "notes", +| | |
107+ "record": { +| | |
108+ "id": 3, +| | |
109+ "page_id": null +| | |
110+ }, +| | |
111+ "schema": "public", +| | |
112+ "columns": [ +| | |
113+ { +| | |
114+ "name": "id", +| | |
115+ "type": "int4" +| | |
116+ }, +| | |
117+ { +| | |
118+ "name": "page_id", +| | |
119+ "type": "int4" +| | |
120+ } +| | |
121+ ], +| | |
122+ "commit_timestamp": "2000-01-01T08:01:01.000Z"+| | |
123+ } | | |
124124(1 row)
125125
126126drop table public.notes;
127127select pg_drop_replication_slot('realtime');
128- pg_drop_replication_slot
128+ pg_drop_replication_slot
129129--------------------------
130-
130+
131131(1 row)
132132
133133truncate table realtime.subscription;
0 commit comments