diff --git a/parsons/databases/postgres/postgres.py b/parsons/databases/postgres/postgres.py index fc1c8c1642..6b90adfe11 100644 --- a/parsons/databases/postgres/postgres.py +++ b/parsons/databases/postgres/postgres.py @@ -87,7 +87,7 @@ def copy( self.query_with_connection(sql, connection, commit=False) logger.info(f"{table_name} created.") - sql = f"COPY {table_name} FROM STDIN CSV HEADER;" + sql = f"COPY {table_name} ({','.join(tbl.columns)}) FROM STDIN CSV HEADER;" with self.cursor(connection) as cursor: cursor.copy_expert(sql, open(tbl.to_csv(), "r"))