Commit 31fb036c authored by ARCHER's avatar ARCHER 💬

schema support in method_copy

parent beba88a2
......@@ -83,10 +83,10 @@ def method_copy(table, conn, keys, data_iter):
columns = ', '.join('"{}"'.format(k) for k in keys)
if table.schema:
table_name = '{}.{}'.format(table.schema, table.name)
table_name = '"{}"."{}"'.format(table.schema, table.name)
else:
table_name = table.name
table_name = '"%s"' % table.name
sql = 'COPY "{}" ({}) FROM STDIN WITH CSV'.format(
table_name, columns)
cur.copy_expert(sql=sql, file=s_buf)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment