AbhimanyuHK / aws-psycopg2

A aws psycopg2 package from psycopg2 https://pypi.org/project/aws-psycopg2/
75 stars 11 forks source link

psycopg2.connect(options="-c search_path=schema" not working in PG 11+ #6

Closed rrjp closed 3 years ago

rrjp commented 3 years ago

Once we upgraded the RDS Postgres server to version 11 setting the search path like:

psycopg2.connect(host="localhost", 
                 port="5432", 
                 user="postgres", 
                 password="password", 
                 database="database", 
                 options="-c search_path=myschema,public")

stopped working. It doesn't give an error during the connect but it doesn't set the path, so all the subsequent queries fail. This worked fine with Postgres 10 on the server, but doesn't work in Postgres 11. It also doesn't work in Postgres 12.4. I noticed from the directions that you are compiling against the Postgres 9.4 code. Maybe it's time to upgrade. If we try and compile our own copy and it works we will let you know.

rrjp commented 3 years ago

I was able to work around this. Not sure it is something that could be fixed client side.