更新时间:2022-11-06 20:40:34
我已经成功使用了此精确设置(psycopg2 + redshift + COPY).之后您承诺了吗? SQL Workbench默认情况下自动提交,而psycopg2默认情况下打开事务,因此直到在连接上调用commit(),数据才可见.
I have used this exact setup (psycopg2 + redshift + COPY) successfully. Did you commit afterwards? SQL Workbench defaults to auto-commit while psycopg2 defaults to opening a transaction, so the data won't be visible until you call commit() on your connection.
完整的工作流程是:
conn = psycopg2.connect(...)
cur = conn.cursor()
cur.execute("COPY...")
conn.commit()
我不认为copy_expert()或任何cursor.copy_ *命令可与Redshift一起使用.
I don't believe that copy_expert() or any of the cursor.copy_* commands work with Redshift.