Christopher Tyler

Include Schema in psycopg2 Connection String

Info from https://stackoverflow.com/questions/59298580/how-to-specify-schema-in-psycopg2-connection-method

If you are using the string form you need to URL escape the options argument:

1
postgresql://user:password@localhost:5432/database_name?options=-csearch_path%3Ddbo,public

This will connect to localhost to database database_name with public schema.

<< Previous Post

|

Next Post >>

#Postgresql #Psycopg2 #Sqlalchemy