Opened 9 months ago

Last modified 2 months ago

#33308 new New feature

Add psycopg3 backend

Reported by: Paolo Melchiorre Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: database postgresql backend orm
Cc: Daniele Varrazzo, אורי, Adam Johnson, Michael P. Jung, Saeed Blanchette, Florian Apolloner, Adam Wróbel, Andreas Rammhold, Alexander Nestorov, Ben Plessinger, Thiago Bellini Ribeiro, Mikail, Anvesh Mishra, Maciej Olko Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

A stable version of Psycopg3 has been released for some time and sub-versions are being released which fix minor problems.
https://github.com/psycopg/psycopg

The author of Psycopg3 himself has already created some demonstration branches with the integration test of Django and Psycopg3.
https://www.psycopg.org/articles/2021/08/02/psycopg3-django-driver/

I propose to add a new database backend for PostgreSQL based on Psycopg3 in parallel with the one based on Psycopg2, we can start from the work already done.
https://github.com/dvarrazzo/django-psycopg3-backend

P.S. In the past I believe there was a similar situation when Psycpg2 support was added in parallel with version 1.

Change History (20)

comment:1 Changed 9 months ago by Daniele Varrazzo

Hello Paolo, thank you for looking into this.

Happy to give you my support, with explanations and eventual changes on the Psycopg side if needed.

comment:2 Changed 9 months ago by Paolo Melchiorre

Hi Daniele, I think the first step for you can be to rebase your Django fork [1] with the official Django [2] repository and then open a PR from your psycopg3-support branch to the Django main branch.

[1] https://github.com/dvarrazzo/django/tree/psycopg3-support
[2] https://github.com/django/django

comment:3 Changed 9 months ago by Daniele Varrazzo

Cc: Daniele Varrazzo added

comment:4 Changed 9 months ago by Arsalan Ghassemi

Triage Stage: UnreviewedAccepted

Adding support for psycopg3 seems relevant since it has a stable release, so I'm tagging it as accepted.

comment:5 Changed 9 months ago by Daniele Varrazzo

Hello Paolo,

I have rebased my Django branch on current main in a new psycopg3-4.1 branch and I have made the django-psycopg3-backend almost compatible with it: there are a few issues described in this commit message, together with how to run tests.

comment:6 Changed 9 months ago by Paolo Melchiorre

Hi Daniele

Thank, I'll take a look at both branches and let you know.

comment:7 Changed 8 months ago by אורי

Cc: אורי added

comment:8 Changed 7 months ago by Adam Johnson

Cc: Adam Johnson added

comment:9 Changed 7 months ago by Michael P. Jung

Cc: Michael P. Jung added

comment:10 Changed 6 months ago by Saeed Blanchette

Cc: Saeed Blanchette added

comment:11 Changed 5 months ago by Florian Apolloner

Cc: Florian Apolloner added

comment:12 Changed 5 months ago by Adam Wróbel

Cc: Adam Wróbel added

comment:13 Changed 4 months ago by Andreas Rammhold

Cc: Andreas Rammhold added

comment:14 Changed 4 months ago by Alexander Nestorov

Cc: Alexander Nestorov added

comment:15 Changed 4 months ago by Ben Plessinger

Cc: Ben Plessinger added

comment:16 Changed 3 months ago by Thiago Bellini Ribeiro

Cc: Thiago Bellini Ribeiro added

comment:17 Changed 3 months ago by Mikail

Cc: Mikail added

comment:18 Changed 2 months ago by Anvesh Mishra

Cc: Anvesh Mishra added

comment:19 Changed 2 months ago by Maciej Olko

Cc: Maciej Olko added

comment:20 Changed 2 months ago by Florian Apolloner

Given the CCs on this ticket I'd highly appreciate review and tests of the PR in https://github.com/django/django/pull/15687 -- remember the more reviews and tests we get the sooner this will get in :)

Note: See TracTickets for help on using tickets.
Back to Top