# prefect-community


05/08/2022, 6:33 PM
Hi, I've set up a Postgres Orion database for registering the states of flows/tasks etc. I noticed they create a structure in public schema. Is it possible to have it create the structure in say prefect-Orion? Use case is that I may want to set up logical replication from that database to another and I would prefer to avoid public (it's already in use by some other database. )

Anna Geller

05/08/2022, 6:52 PM
You may have multiple logical databases inside of your Postgres instance. One possibility is to have the default
DB for one thing, and then you may use
database for Prefect 2.0. Here is how you could configure that:
Copy code
export PREFECT_ORION_DATABASE_CONNECTION_URL="<postgresql+asyncpg://postgres:yourTopSecretPassword@localhost:5432/orion>"
👍 1
Alternatively, you may consider creating an individual Postgres instance for Prefect 2.0 which may be easier to separate concerns, scale and manage it long term. Especially, as it's so easy these days to spin up multiple (even fully managed) Postgres databases in the public cloud, managing multiple applications within the same logical database only by separating it via schema, feels like adding unnecessary complexity
👍 1