本文介绍了psycopg2.ProgrammingError:“ stdin”处或附近的语法错误。尝试从redshift复制时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试复制到AWS redshift时遇到此问题。 这是我要运行的代码:
I am having this problem when I am trying to copy to AWS redshift. This is the code I am trying to run:
with open('path/to/files, 'rb') as fo: cursor.copy_from(fo, 'schema.table', sep=',') cursormit()我遇到了错误:
psycopg2.ProgrammingError: syntax error at or near "stdin" LINE 1: ...Y schema.table FROM stdin WITH...我正在使用psycopg2运行python 3.5。 希望你们能提供帮助!
I am running python 3.5 with psycopg2. Hope that you guys can help! Thx in advance!
推荐答案AWS Redshift不是PostgreSQL,尽管它支持PostgreSQL语法和功能的子集。
AWS Redshift is not PostgreSQL, though it supports a subset of PostgreSQL syntax and functionality.
它没有 COPY ...从STDIN c复制。
有关如何使用的信息,请参见手册。在Redshift上复制。
See the manual for how to use COPY on Redshift.
更多推荐
psycopg2.ProgrammingError:“ stdin”处或附近的语法错误。尝试从redshift复制时出错
发布评论