Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 4df9f62

Browse files
committed
Escape invalid strings
By default tap Postgres uses dollar quotes (https://www.postgresql.org/docs/8.0/plpgsql-development-tips.html) to escape string values. This caused us a bunch of troubles so we decided to replace them with good old query parameters.
1 parent f33e067 commit 4df9f62

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tap_postgres/sync_strategies/logical_replication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ def create_array_elem(elem, sql_datatype, conn_info):
136136
#custom datatypes like enums
137137
cast_datatype = 'text[]'
138138

139-
sql_stmt = """SELECT $stitch_quote${}$stitch_quote$::{}""".format(elem, cast_datatype)
140-
cur.execute(sql_stmt)
139+
sql_stmt = 'select %s::{}'.format(cast_datatype)
140+
cur.execute(sql_stmt, (elem, ))
141141
res = cur.fetchone()[0]
142142
return res
143143

0 commit comments

Comments
 (0)