Skip to content

Commit

Permalink
fix: double quotes on table names (#228)
Browse files Browse the repository at this point in the history
* fix: double quotes on table names

* fix: need another set of quotes and updated tests
  • Loading branch information
vjeeva committed May 4, 2023
1 parent b6bb618 commit 893773a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pgbelt/util/pglogical.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async def configure_replication_set(
async with conn.transaction():
try:
await conn.execute(
f"SELECT pglogical.replication_set_add_table('default', '{table}');"
f"SELECT pglogical.replication_set_add_table('default', '\"{table}\"');"
)
logger.debug(f"{table} added to default replication set")
except UniqueViolationError:
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/files/test_schema_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ALTER TABLE public.fruits OWNER TO owner;
-- Name: users; Type: TABLE; Schema: public; Owner: owner
--

CREATE TABLE public.users (
CREATE TABLE public.Users (
id bigint NOT NULL,
hash_firstname text NOT NULL,
hash_lastname text NOT NULL,
Expand All @@ -23,7 +23,7 @@ CREATE TABLE public.users (
);


ALTER TABLE public.users OWNER TO owner;
ALTER TABLE public.Users OWNER TO owner;

--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: owner
Expand All @@ -49,7 +49,7 @@ INSERT INTO public.fruits (id, name)
(4, 'grape');

--
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: owner
-- Data for Name: Users; Type: TABLE DATA; Schema: public; Owner: owner
--

INSERT INTO public.users (id, hash_firstname, hash_lastname, gender)
Expand All @@ -68,8 +68,8 @@ SELECT pg_catalog.setval('public.users_id_seq', 1, false);


--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: owner
-- Name: Users users_pkey; Type: CONSTRAINT; Schema: public; Owner: owner
--

ALTER TABLE ONLY public.users
ALTER TABLE ONLY public.Users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);

0 comments on commit 893773a

Please sign in to comment.