This is an automated email from the ASF dual-hosted git repository.
shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new d713e2d813e Document psycopg3 driver switch for PostgresHook
connections (#70360)
d713e2d813e is described below
commit d713e2d813ee0a7bca5aa13efb7b352ba4624db8
Author: Shahar Epstein <[email protected]>
AuthorDate: Fri Jul 24 11:09:04 2026 +0300
Document psycopg3 driver switch for PostgresHook connections (#70360)
The 7.0.0 breaking-change notes describe only the metadata database, so a
user on Airflow 3.2 or 3.3 reading them concludes they are unaffected until
3.4. In fact PostgresHook picks its driver independently, from the installed
SQLAlchemy version, so their task connections switch to psycopg3 on upgrade
with no connection-URL or config opt-out available.
---
providers/postgres/docs/changelog.rst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/providers/postgres/docs/changelog.rst
b/providers/postgres/docs/changelog.rst
index 58c064600e6..d7cb4899d2f 100644
--- a/providers/postgres/docs/changelog.rst
+++ b/providers/postgres/docs/changelog.rst
@@ -63,6 +63,21 @@ Breaking changes
To keep using psycopg2 on Airflow 3.4.0+, set
``[database] sql_alchemy_conn = postgresql+psycopg2://...`` explicitly.
+.. note::
+ The two notes above describe the **metadata database** only. Independently
of them,
+ ``PostgresHook`` selects ``psycopg`` (psycopg3) for the connections it
opens whenever
+ SQLAlchemy 2.x is installed — the default on Airflow 3.2 and later, and
also the case on
+ Airflow 3.1 if SQLAlchemy has been upgraded to 2.x. Airflow 2.11 and 3.0
pin SQLAlchemy below
+ 2.0 and are unaffected.
+
+ The ``google``, ``pgvector`` and ``amazon`` (Redshift
SQLAlchemy/OpenLineage engine)
+ integrations follow the same selection, as does a Celery
``result_backend`` derived from the
+ metadata-database URL — unless ``[celery] result_backend`` is set
explicitly.
+
+ There is no connection or configuration option to keep hooks on psycopg2;
the
+ ``sql_alchemy_conn`` workarounds above cover the metadata database only.
If your Dags rely on
+ psycopg2-specific behaviour, test before upgrading or pin the provider
below 7.0.0.
+
* ``Make psycopg (v3) the default synchronous Postgres driver (#69526)``
* ``Switch the default async Postgres driver from asyncpg to psycopg3
(#69089)``