Skip to content

Commit 7d70a12

Browse files
committed
Default schema to 'public'
1 parent 0ee4011 commit 7d70a12

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

postgres_copy/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ def copy_from(source, dest, engine, **flags):
5454
conn = engine.raw_connection()
5555
cursor = conn.cursor()
5656
formatted_flags = '({})'.format(format_flags(flags)) if flags else ''
57-
copy = 'COPY "{}"."{}" FROM STDIN {}'.format(tbl.schema, tbl.name, formatted_flags)
57+
copy = 'COPY "{}"."{}" FROM STDIN {}'.format(
58+
tbl.schema or 'public',
59+
tbl.name,
60+
formatted_flags
61+
)
5862
cursor.copy_expert(copy, source)
5963
conn.commit()
6064
conn.close()

0 commit comments

Comments
 (0)