diff --git a/test/expected/test_space_in_name.out b/test/expected/test_space_in_name.out new file mode 100644 index 0000000..bfba0c6 --- /dev/null +++ b/test/expected/test_space_in_name.out @@ -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; diff --git a/test/sql/test_space_in_name.sql b/test/sql/test_space_in_name.sql new file mode 100644 index 0000000..4c0da74 --- /dev/null +++ b/test/sql/test_space_in_name.sql @@ -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; +select pg_drop_replication_slot('realtime'); +truncate table realtime.subscription;