pythonlinuxsqlalchemyamazon-redshiftpsycopg2

unrecognized configuration parameter "standard_conforming_strings" while querying from Redshift


I am trying to connect to my redshift cluster using Sqlalchemy in a linux environment, but i am facing the following issue.

from sqlalchemy import create_engine
import pandas as pd
conn = create_engine('postgresql://connection string')
data_frame = pd.read_sql_query("SELECT * FROM schema.table", conn)

sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) unrecognized configuration parameter "standard_conforming_strings"

I really dont understand what the issue is. It works perfectly fine in Windows.

PS: Not sure if this makes any difference but i have installed psycopg2-binary on the linux machine in contrast to psycopg2 on windows.

EDIT

1 .The version of pyscopg2 is windows is 2.9.3 while the version of pyscopg2-binary in linux is 2.9.6

  1. The version of Sqlalchemy in windows is 1.4.39 while in linux is 2.0.16

Solution

  • I have figured out the answer based on the comment by @Adrian . Just changed the version of Sql alchemy on the linux env to what i have on Windows and it works now.