小编Lar*_*rry的帖子

psycopg2.ProgrammingError:尝试copy_from redshift时出现"stdin"错误或其附近的语法错误

当我尝试复制到AWS redshift时遇到此问题.这是我试图运行的代码:

with open('path/to/files, 'rb') as fo:
    cursor.copy_from(fo, 'schema.table', sep=',')
    cursor.commit()
Run Code Online (Sandbox Code Playgroud)

我遇到了错误:

psycopg2.ProgrammingError: syntax error at or near "stdin" 
LINE 1: ...Y schema.table FROM stdin WITH...
Run Code Online (Sandbox Code Playgroud)

我用psycopg2运行python 3.5.希望你们能帮忙!Thx提前!

postgresql stdin psycopg2 python-3.x amazon-redshift

3
推荐指数
1
解决办法
1893
查看次数