Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions providers/postgres/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ PIP package Version required
``psycopg2-binary`` ``>=2.9.10; python_version >= "3.13"``
``psycopg[binary]`` ``>=3.2.9; python_version < "3.14"``
``psycopg[binary]`` ``>=3.3.3; python_version >= "3.14"``
``asyncpg`` ``>=0.30.0``
========================================== ======================================

Optional cross provider package dependencies
Expand Down
19 changes: 12 additions & 7 deletions providers/postgres/docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@ Breaking changes
~~~~~~~~~~~~~~~~

.. note::
The default async metadata-database driver is now ``psycopg`` (psycopg3),
which is installed by default in place of ``asyncpg``. As a result, the
``[psycopg]`` optional extra was removed and ``[asyncpg]`` was added.

Starting with Airflow 3.4.0, the default derived async connection URL changes from
On Airflow 3.4.0 and later, the default async metadata-database driver becomes
``psycopg`` (psycopg3): the derived async connection URL changes from
``postgresql+asyncpg://`` to ``postgresql+psycopg_async://``, which is safe behind
transaction-mode PgBouncer with no extra configuration. To keep using asyncpg, install
``apache-airflow-providers-postgres[asyncpg]`` and set
transaction-mode PgBouncer with no extra configuration. ``psycopg[binary]`` is now
installed by default to serve it.

``asyncpg`` remains installed by default as well. This provider still supports Airflow
cores older than 3.4.0, which derive the async URL as ``postgresql+asyncpg://``
unconditionally and have no psycopg fallback — so asyncpg must stay present for them to
work. It will become opt-in-only (via the existing ``[asyncpg]`` extra) in a future
release once the minimum supported Airflow is 3.4.0.

To keep using asyncpg on Airflow 3.4.0+, set
``[database] sql_alchemy_conn_async = postgresql+asyncpg://...`` explicitly.

* ``Switch the default async Postgres driver from asyncpg to psycopg3 (#69089)``
Expand Down
1 change: 1 addition & 0 deletions providers/postgres/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ PIP package Version required
``psycopg2-binary`` ``>=2.9.10; python_version >= "3.13"``
``psycopg[binary]`` ``>=3.2.9; python_version < "3.14"``
``psycopg[binary]`` ``>=3.3.3; python_version >= "3.14"``
``asyncpg`` ``>=0.30.0``
========================================== ======================================

Optional cross provider package dependencies
Expand Down
7 changes: 7 additions & 0 deletions providers/postgres/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ dependencies = [
"psycopg2-binary>=2.9.10; python_version >= '3.13'",
"psycopg[binary]>=3.2.9; python_version < '3.14'",
"psycopg[binary]>=3.3.3; python_version >= '3.14'",
# asyncpg must stay a default dependency while this provider still supports Airflow
# cores older than 3.4.0: those cores derive the async metadata-DB URL as
# ``postgresql+asyncpg://`` unconditionally and have no psycopg_async fallback, so
# dropping asyncpg breaks their async engine. Make it opt-in-only (via the ``[asyncpg]``
# extra) only once the minimum supported Airflow is >= 3.4.0; tracked at
# https://github.com/apache/airflow/issues/68453
"asyncpg>=0.30.0",
]

# The optional dependencies should be modified in place in the generated file
Expand Down
2 changes: 2 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.