psycopg2.ProgrammingError:“ stdin”处或附近的语法错误。尝试从redshift复制时出错

编程入门 行业动态 更新时间:2024-10-22 20:26:10
本文介绍了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

有关如何使用的信息,请参见手册。在Redshift上复制。

See the manual for how to use COPY on Redshift.

更多推荐

psycopg2.ProgrammingError:“ stdin”处或附近的语法错误。尝试从redshift复制时出错

本文发布于:2023-10-14 22:00:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1492336.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:语法错误   ProgrammingError   redshift   stdin

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!