Skip to content Skip to sidebar Skip to footer

Psycopg2.programmingerror: Syntax Error At Or Near "stdin" Error When Trying To Copy_from 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.tabl

Solution 1:

AWS Redshift is not PostgreSQL, though it supports a subset of PostgreSQL syntax and functionality.

It does not have COPY ... FROM STDIN.

See the manual for how to use COPY on Redshift.

Solution 2:

check this solution Python psycopg2 insert NULL in some rows in postgresql table

for insert multiple rows or python dataframe in Redshift

Post a Comment for "Psycopg2.programmingerror: Syntax Error At Or Near "stdin" Error When Trying To Copy_from Redshift"