diff --git a/docs/apache-airflow/howto/set-up-database.rst b/docs/apache-airflow/howto/set-up-database.rst index be9a19b80320a..a23e4bc2b5d5c 100644 --- a/docs/apache-airflow/howto/set-up-database.rst +++ b/docs/apache-airflow/howto/set-up-database.rst @@ -218,8 +218,17 @@ We recommend using the ``psycopg2`` driver and specifying it in your SqlAlchemy postgresql+psycopg2://:@/ -Also note that since SqlAlchemy does not expose a way to target a specific schema in the database URI, you may -want to set a default schema for your role with a SQL statement similar to ``ALTER ROLE username SET search_path = airflow, foobar;`` +Also note that since SqlAlchemy does not expose a way to target a specific schema in the database URI, you need to ensure schema ``public`` is in your Postgres user's search_path. + +If you created a new Postgres account for Airflow: + +* The default search_path for new Postgres user is: ``"$user", public``, no change is needed. + +If you use a current Postgres user with custom search_path, search_path can be changed by the command: + +.. code-block:: sql + + ALTER USER airflow_user SET search_path = public; For more information regarding setup of the PostgresSQL connection, see `PostgreSQL dialect `__ in SQLAlchemy documentation.