Skip to content

Upgrade the postgres driver (psycopg) from v2 to v3 #52976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dev-iL
Copy link
Contributor

@Dev-iL Dev-iL commented Jul 7, 2025

At the time of writing, the postgres driver psycopg2 (aka "v2") hasn't been updated for ~9 months. There exists a solution in the form of a new version ("v3"):

Psycopg 3 is the new implementation of Psycopg 2. It emerges from the experience of more than 10 years of development and support of psycopg2. It embraces the new possibilities offered by the more modern generations of the Python language and the PostgreSQL database and addresses the challenges offered by the current patterns in software development and deployment.

In an effort to keep up with modern dependencies, this PR attempts to upgrade the postgres provider from using psycopg v2 to v3. While in the initial version of the PR v2 support is dropped completely, a gradual transition with dual support is likely doable.

As a side note - v3 should synergize nicely with SQLA2.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant