2

I want to connect to a postgres database in a specific squema using psycopg2. I read this thread but I get a syntax error.

schema = conf['schema']
conn = psycopg2.connect(
    dbname=conf['database'],
    user=conf['user'],
    host=conf['host'],
    password=conf['passw'],
    port=conf['port'],
    options=f'-c search_path={schema}',
)

I checked the config.json where I get the data.

Thanks

Aceconhielo
  • 3,316
  • 4
  • 19
  • 26

0 Answers0