Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions test/expected/test_space_in_name.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
select 1 from pg_create_logical_replication_slot('realtime', 'wal2json', false);
?column?
----------
1
(1 row)

create table public."User Notes"(
id int primary key
);
insert into realtime.subscription(subscription_id, entity, claims)
select
seed_uuid(1),
'"User Notes"'::regclass,
jsonb_build_object(
'role', 'authenticated',
'email', 'example@example.com',
'sub', seed_uuid(1)::text
);
select clear_wal();
clear_wal
-----------

(1 row)

insert into public."User Notes"(id) values (1);
select
rec,
is_rls_enabled,
subscription_ids,
errors
from
walrus;
rec | is_rls_enabled | subscription_ids | errors
----------------------------------------------------+----------------+----------------------------------------+--------
{ +| f | {f4539ebe-c779-5788-bbc1-2421ffaa8954} | {}
"type": "INSERT", +| | |
"table": "User Notes", +| | |
"record": { +| | |
"id": 1 +| | |
}, +| | |
"schema": "public", +| | |
"columns": [ +| | |
{ +| | |
"name": "id", +| | |
"type": "int4" +| | |
} +| | |
], +| | |
"commit_timestamp": "2000-01-01T08:01:01.000Z"+| | |
} | | |
(1 row)

drop table public.notes;
ERROR: table "notes" does not exist
select pg_drop_replication_slot('realtime');
pg_drop_replication_slot
--------------------------

(1 row)

truncate table realtime.subscription;
31 changes: 31 additions & 0 deletions test/sql/test_space_in_name.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
select 1 from pg_create_logical_replication_slot('realtime', 'wal2json', false);

create table public."User Notes"(
id int primary key
);

insert into realtime.subscription(subscription_id, entity, claims)
select
seed_uuid(1),
'"User Notes"'::regclass,
jsonb_build_object(
'role', 'authenticated',
'email', 'example@example.com',
'sub', seed_uuid(1)::text
);

select clear_wal();
insert into public."User Notes"(id) values (1);

select
rec,
is_rls_enabled,
subscription_ids,
errors
from
walrus;


drop table public.notes;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
drop table public.notes;
drop table public."User Notes";

Wrong table?

select pg_drop_replication_slot('realtime');
truncate table realtime.subscription;