https://prefect.io logo
Title
x

Xavier Babu

06/16/2022, 7:55 PM
Hi team, In Prefect Orion, how to specific postgres connection url with specific schema (instead of using public)? I am trying to use postgres instead of SQLite.
k

Kevin Kho

06/16/2022, 7:57 PM
Hi Xavier, have you seen this page?
x

Xavier Babu

06/16/2022, 7:59 PM
Kevin, I did. But it doesn't have info about how to specify the schema name in the connection URL.
k

Kevin Kho

06/16/2022, 8:01 PM
ah i see what you mean
I’d need to ask the team on this
We don’t design to give our schemas prefect-prefixed names to guarantee against collision with other schemas, because we don’t develop anticipating overlapping databases. You could change the default schema for the db user you’re using for Orion, on the postgres side with:
ALTER USER my_user WITH DEFAULT_SCHEMA = OtherSchema;
Note this is not recommended because it may cause future issues
x

Xavier Babu

06/17/2022, 2:10 PM
Alter user works for me. But I can't create new user for every environment. Choosing different schema is the right way to address this issue.
k

Kevin Kho

06/17/2022, 2:44 PM
Our recommendation here is for things to be separated by different databases (on the same pg server)