[Django] #33308: Add psycopg3 backend

138 views
Skip to first unread message

Django

unread,
Nov 22, 2021, 7:05:35 AM11/22/21
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo | Owner: nobody
Melchiorre |
Type: New | Status: new
feature |
Component: Database | Version: dev
layer (models, ORM) | Keywords: database postgresql
Severity: Normal | backend orm
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33308>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 22, 2021, 7:26:05 AM11/22/21
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage:
backend orm | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:1>

Django

unread,
Nov 22, 2021, 8:53:43 AM11/22/21
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage:
backend orm | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (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

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:2>

Django

unread,
Nov 22, 2021, 12:14:36 PM11/22/21
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage:
backend orm | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Daniele Varrazzo):

* cc: Daniele Varrazzo (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:3>

Django

unread,
Nov 22, 2021, 7:05:46 PM11/22/21
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Arsalan Ghassemi):

* stage: Unreviewed => Accepted


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:4>

Django

unread,
Nov 23, 2021, 10:56:46 AM11/23/21
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Daniele Varrazzo):

Hello Paolo,

I have rebased my Django branch on current main in a new
[https://github.com/dvarrazzo/django/tree/psycopg3-4.1 psycopg3-4.1
branch] and I have made the [https://github.com/dvarrazzo/django-
psycopg3-backend django-psycopg3-backend] ''almost'' compatible with it:
there are a few issues described [https://github.com/dvarrazzo/django-
psycopg3-backend/commit/17cd24ae8eb49025b2a859c19a2a30081c2a028b in this
commit message], together with how to run tests.

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:5>

Django

unread,
Nov 23, 2021, 4:21:31 PM11/23/21
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Paolo Melchiorre):

Hi Daniele

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

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:6>

Django

unread,
Dec 27, 2021, 11:31:31 AM12/27/21
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by אורי):

* cc: אורי (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:7>

Django

unread,
Jan 23, 2022, 4:26:35 AM1/23/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam Johnson):

* cc: Adam Johnson (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:8>

Django

unread,
Jan 24, 2022, 7:56:06 AM1/24/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michael P. Jung):

* cc: Michael P. Jung (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:9>

Django

unread,
Feb 18, 2022, 4:01:19 PM2/18/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Saeed Blanchette):

* cc: Saeed Blanchette (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:10>

Django

unread,
Mar 5, 2022, 2:35:30 PM3/5/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Florian Apolloner):

* cc: Florian Apolloner (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:11>

Django

unread,
Mar 16, 2022, 7:16:27 AM3/16/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam Wróbel):

* cc: Adam Wróbel (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:12>

Django

unread,
Apr 21, 2022, 6:07:28 AM4/21/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Andreas Rammhold):

* cc: Andreas Rammhold (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:13>

Django

unread,
Apr 23, 2022, 5:27:26 PM4/23/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Alexander Nestorov):

* cc: Alexander Nestorov (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:14>

Django

unread,
Apr 27, 2022, 3:39:14 PM4/27/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ben Plessinger):

* cc: Ben Plessinger (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:15>

Django

unread,
May 13, 2022, 4:48:40 PM5/13/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Thiago Bellini Ribeiro):

* cc: Thiago Bellini Ribeiro (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:16>

Django

unread,
May 27, 2022, 9:34:09 AM5/27/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mika):

* cc: Mika (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:17>

Django

unread,
May 29, 2022, 5:54:24 PM5/29/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Anvesh Mishra):

* cc: Anvesh Mishra (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:18>

Django

unread,
May 31, 2022, 10:06:09 AM5/31/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Maciej Olko):

* cc: Maciej Olko (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:19>

Django

unread,
Jun 5, 2022, 3:50:33 AM6/5/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (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 :)

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:20>

Django

unread,
Sep 2, 2022, 1:44:21 AM9/2/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ülgen Sarıkavak):

* cc: Ülgen Sarıkavak (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:21>

Django

unread,
Oct 6, 2022, 5:16:24 AM10/6/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"04518e310d4552ff7595a34f5a7f93487d78a406" 04518e31]:
{{{
#!CommitTicketReference repository=""
revision="04518e310d4552ff7595a34f5a7f93487d78a406"
Refs #33308 -- Enabled explicit GROUP BY and ORDER BY aliases.

This ensures explicit grouping from using values() before annotating an
aggregate function groups by selected aliases if supported.

The GROUP BY feature is disabled on Oracle because it doesn't support it.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:22>

Django

unread,
Oct 20, 2022, 1:45:46 PM10/20/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned

Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Paolo Melchiorre):

* owner: nobody => Florian Apolloner
* status: new => assigned


Comment:

Assign to @apollo13 because he's working on this issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:23>

Django

unread,
Nov 7, 2022, 1:34:35 PM11/7/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"7990d254b0af158baf827fafbd90fe8e890f23bd" 7990d25]:
{{{
#!CommitTicketReference repository=""
revision="7990d254b0af158baf827fafbd90fe8e890f23bd"
Refs #33308 -- Improved adapting DecimalField values to decimal.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:24>

Django

unread,
Nov 16, 2022, 2:07:24 AM11/16/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"d87a7b9f4b4c75fc03ce6bbf55c880a79d524306" d87a7b9]:
{{{
#!CommitTicketReference repository=""
revision="d87a7b9f4b4c75fc03ce6bbf55c880a79d524306"
Refs #33308 -- Stopped inheriting from FieldGetDbPrepValueMixin by
PostgresOperatorLookup.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:25>

Django

unread,
Nov 16, 2022, 2:07:25 AM11/16/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"5c23d9f0c32f166c81ecb6f3f01d5077a6084318" 5c23d9f]:
{{{
#!CommitTicketReference repository=""
revision="5c23d9f0c32f166c81ecb6f3f01d5077a6084318"
Refs #33308 -- Used get_db_prep_value() to adapt JSONFields.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:26>

Django

unread,
Nov 16, 2022, 10:10:22 AM11/16/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sage Abdullah):

* cc: Sage Abdullah (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:27>

Django

unread,
Dec 1, 2022, 3:18:35 AM12/1/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"3cafb783f3f711c7413ba2b8d7c8ff750bd4d6e1" 3cafb783]:
{{{
#!CommitTicketReference repository=""
revision="3cafb783f3f711c7413ba2b8d7c8ff750bd4d6e1"
Refs #33308 -- Used psycopg's errors instead of errorcodes.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:28>

Django

unread,
Dec 1, 2022, 4:37:10 AM12/1/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"149b55fefad03c18589d580ef53d41e7c99408ed" 149b55f]:
{{{
#!CommitTicketReference repository=""
revision="149b55fefad03c18589d580ef53d41e7c99408ed"
Refs #33308 -- Ensured type handlers are registered for all PostgreSQL
specific tests.

Co-authored-by: Mariusz Felisiak <felisiak...@gmail.com>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:29>

Django

unread,
Dec 1, 2022, 7:12:49 AM12/1/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"d3e746ace5eeea07216da97d9c3801f2fdc43223" d3e746ac]:
{{{
#!CommitTicketReference repository=""
revision="d3e746ace5eeea07216da97d9c3801f2fdc43223"
Refs #33308 -- Added get_type_oids() hook and simplified registering type
handlers on PostgreSQL.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:30>

Django

unread,
Dec 1, 2022, 1:51:46 PM12/1/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"0ff46591ac3010841c73fd26e0fef93995fedd99" 0ff4659]:
{{{
#!CommitTicketReference repository=""
revision="0ff46591ac3010841c73fd26e0fef93995fedd99"
Refs #33308 -- Deprecated support for passing encoded JSON string literals
to JSONField & co.

JSON should be provided as literal Python objects an not in their
encoded string literal forms.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:31>

Django

unread,
Dec 2, 2022, 4:54:23 AM12/2/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"2fecf99ade208e3a80958ee4fc28ff62549c575b" 2fecf99]:
{{{
#!CommitTicketReference repository=""
revision="2fecf99ade208e3a80958ee4fc28ff62549c575b"
Refs #33308 -- Made PostGISAdapter do not use psycopg2's Binary().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:32>

Django

unread,
Dec 2, 2022, 5:17:36 AM12/2/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by אורי):

* cc: אורי (removed)


--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:33>

Django

unread,
Dec 2, 2022, 7:21:10 AM12/2/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"3e3b7f691b5cc41c357966ce3f91a8d13c6c1d4d" 3e3b7f6]:
{{{
#!CommitTicketReference repository=""
revision="3e3b7f691b5cc41c357966ce3f91a8d13c6c1d4d"
Refs #33308 -- Avoided passing None to RawSQL's params.

Passing None to params causes errors in determining the data type on
psycopg3.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:34>

Django

unread,
Dec 6, 2022, 6:50:32 AM12/6/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"6a2165816394ab4bb259f6171e82417e098e97a6" 6a216581]:
{{{
#!CommitTicketReference repository=""
revision="6a2165816394ab4bb259f6171e82417e098e97a6"
Refs #33308 -- Modernized database wrapper in the PostgreSQL backend.

- Used connection.info instead of connection.get_parameter_status() and
connection.server_info which don't exist in psycopg 3.
- Set encoding using the client_encoding connection parameter instead
of connection.set_client_encoding() that doesn't exist in psycopg 3.
- Used the dbname connection parameter instead of deprecated
alias - database.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:35>

Django

unread,
Dec 12, 2022, 5:29:23 AM12/12/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"2ebfbd894e21e1656c1e1f32d98b8df7a32d3649" 2ebfbd89]:
{{{
#!CommitTicketReference repository=""
revision="2ebfbd894e21e1656c1e1f32d98b8df7a32d3649"
Refs #33308 -- Moved psycopg2 imports to the psycopg_any module.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:36>

Django

unread,
Dec 12, 2022, 5:29:24 AM12/12/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"2f38f7b8f9bd65905dc6bec4f3e2a30b5da8e338" 2f38f7b]:
{{{
#!CommitTicketReference repository=""
revision="2f38f7b8f9bd65905dc6bec4f3e2a30b5da8e338"
Refs #33308 -- Added psycopg_any.sql.quote() hook.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:37>

Django

unread,
Dec 12, 2022, 5:31:25 AM12/12/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"1d90c9b1132482d446ca8375c151e894002c9e8d" 1d90c9b]:
{{{
#!CommitTicketReference repository=""
revision="1d90c9b1132482d446ca8375c151e894002c9e8d"
Refs #33308 -- Added psycopg_any.IsolationLevel.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:38>

Django

unread,
Dec 12, 2022, 5:35:03 AM12/12/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Accepted
backend orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"db7bb3b64e469fbb5c79e7b5b2fcb890434aa60f" db7bb3b6]:
{{{
#!CommitTicketReference repository=""
revision="db7bb3b64e469fbb5c79e7b5b2fcb890434aa60f"
Refs #33308 -- Added DatabaseOperations.compose_sql() on PostgreSQL.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:39>

Django

unread,
Dec 14, 2022, 6:01:49 AM12/14/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: database postgresql | Triage Stage: Ready for
backend orm | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* has_patch: 0 => 1
* stage: Accepted => Ready for checkin


Comment:

[https://github.com/django/django/pull/15687 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:40>

Django

unread,
Dec 15, 2022, 1:35:36 AM12/15/22
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: closed

Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: database postgresql | Triage Stage: Ready for
backend orm | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca" 09ffc5c]:
{{{
#!CommitTicketReference repository=""
revision="09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca"
Fixed #33308 -- Added support for psycopg version 3.

Thanks Simon Charette, Tim Graham, and Adam Johnson for reviews.

Co-authored-by: Florian Apolloner <flo...@apolloner.eu>
Co-authored-by: Mariusz Felisiak <felisiak...@gmail.com>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:41>

Django

unread,
Feb 18, 2023, 10:29:02 AM2/18/23
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: database postgresql | Triage Stage: Ready for
backend orm | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"a6511bc23329f1d3939571ad01d3176f8f6cb786" a6511bc]:
{{{
#!CommitTicketReference repository=""
revision="a6511bc23329f1d3939571ad01d3176f8f6cb786"
Refs #33308 -- Added tests for queryset ordered by annotation with
nulls_first/nulls_last.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:42>

Django

unread,
Feb 18, 2023, 10:29:25 AM2/18/23
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: database postgresql | Triage Stage: Ready for
backend orm | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"312d0f88b4ba47278f53f37ee2735309eda3e913" 312d0f88]:
{{{
#!CommitTicketReference repository=""
revision="312d0f88b4ba47278f53f37ee2735309eda3e913"
[4.2.x] Refs #33308 -- Added tests for queryset ordered by annotation with
nulls_first/nulls_last.

Backport of a6511bc23329f1d3939571ad01d3176f8f6cb786 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:43>

Django

unread,
May 24, 2023, 5:00:45 AM5/24/23
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: database postgresql | Triage Stage: Ready for
backend orm | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"0c1518ee429b01c145cf5b34eab01b0b92f8c246" 0c1518e]:
{{{
#!CommitTicketReference repository=""
revision="0c1518ee429b01c145cf5b34eab01b0b92f8c246"
Fixed #34590 -- Reverted "Refs #33308 -- Improved adapting DecimalField
values to decimal."

This reverts 7990d254b0af158baf827fafbd90fe8e890f23bd.

Thanks Marc Odermatt for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:44>

Django

unread,
May 24, 2023, 5:01:03 AM5/24/23
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: database postgresql | Triage Stage: Ready for
backend orm | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"91f8df5c2e711ff4b3d10602181d8a6daa62a93a" 91f8df5c]:
{{{
#!CommitTicketReference repository=""
revision="91f8df5c2e711ff4b3d10602181d8a6daa62a93a"
[4.2.x] Fixed #34590 -- Reverted "Refs #33308 -- Improved adapting
DecimalField values to decimal."

This reverts 7990d254b0af158baf827fafbd90fe8e890f23bd.

Thanks Marc Odermatt for the report.

Backport of 0c1518ee429b01c145cf5b34eab01b0b92f8c246 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:45>

Django

unread,
Sep 18, 2023, 4:12:52 PM9/18/23
to django-...@googlegroups.com
#33308: Add psycopg3 backend
-------------------------------------+-------------------------------------
Reporter: Paolo Melchiorre | Owner: Florian
| Apolloner
Type: New feature | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: database postgresql | Triage Stage: Ready for
backend orm | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"5e4c1793b714a975400b9277a66f99efafa2d92c" 5e4c179]:
{{{
#!CommitTicketReference repository=""
revision="5e4c1793b714a975400b9277a66f99efafa2d92c"
Refs #33308 -- Removed support for passing encoded JSON string literals to
JSONField & co.

Per deprecation timeline.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33308#comment:46>

Reply all
Reply to author
Forward
0 new messages