Re: [Django] #35734: JSONObject crashes with Postgres 16 and server side bindings

13 views
Skip to first unread message

Django

unread,
Sep 20, 2024, 11:59:05 AM9/20/24
to django-...@googlegroups.com
#35734: JSONObject crashes with Postgres 16 and server side bindings
-------------------------------------+-------------------------------------
Reporter: john-parton | Owner: john-
| parton
Type: Bug | Status: assigned
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by john-parton):

Replying to [comment:11 Sarah Boyce]:
>
[https://github.com/django/django/commit/0f53d48115ba0295cefea33512dc146caad39443
Here is an approach] which uses the native `JSONObject` function for
server side bindings, casting the keys to text. Adding it here for a
record.

I can create a separate ticket for this. "Enhancement", something like
"use native JSONObject on Postgres 16+ with server side bindings"?

I'm assuming that it's a "good thing" to prefer the native JSONObject over
just using jsonb_build_object all the time. In my experience, there is no
_practical_ difference, but I'm assuming the original change was accepted
because when support for Postgres 14 and 15 is dropped, we can drop the
jsonb_build_object code path with a simple delete. Does that sound right?
--
Ticket URL: <https://code.djangoproject.com/ticket/35734#comment:14>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 20, 2024, 2:22:35 PM9/20/24
to django-...@googlegroups.com
#35734: JSONObject crashes with Postgres 16 and server side bindings
-------------------------------------+-------------------------------------
Reporter: john-parton | Owner: john-
| parton
Type: Bug | Status: assigned
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by john-parton):

I've created the separate ticket to track use of the native json object
with postgres 16+ and server side bindings:
https://code.djangoproject.com/ticket/35778#ticket
--
Ticket URL: <https://code.djangoproject.com/ticket/35734#comment:15>

Django

unread,
Sep 26, 2024, 10:19:43 AM9/26/24
to django-...@googlegroups.com
#35734: JSONObject crashes with Postgres 16 and server side bindings
-------------------------------------+-------------------------------------
Reporter: john-parton | Owner: john-
| parton
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

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

Comment:

In [changeset:"f22ff4561ada77be98ca4db3ce117caca897696e" f22ff456]:
{{{#!CommitTicketReference repository=""
revision="f22ff4561ada77be98ca4db3ce117caca897696e"
Fixed #35734 -- Used JSONB_BUILD_OBJECT database function on PostgreSQL
when using server-side bindings.

Regression in 81ccf92f154c6d9eac3e30bac0aa67574d0ace15.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35734#comment:16>

Django

unread,
Sep 26, 2024, 10:20:47 AM9/26/24
to django-...@googlegroups.com
#35734: JSONObject crashes with Postgres 16 and server side bindings
-------------------------------------+-------------------------------------
Reporter: john-parton | Owner: john-
| parton
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Ready for checkin

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

Django

unread,
Sep 26, 2024, 10:24:02 AM9/26/24
to django-...@googlegroups.com
#35734: JSONObject crashes with Postgres 16 and server side bindings
-------------------------------------+-------------------------------------
Reporter: john-parton | Owner: john-
| parton
Type: Bug | Status: closed
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"22bce642a9d118b97cd0c5e00ec346575c729c6f" 22bce642]:
{{{#!CommitTicketReference repository=""
revision="22bce642a9d118b97cd0c5e00ec346575c729c6f"
[5.1.x] Fixed #35734 -- Used JSONB_BUILD_OBJECT database function on
PostgreSQL when using server-side bindings.

Regression in 81ccf92f154c6d9eac3e30bac0aa67574d0ace15.

Backport of f22ff4561ada77be98ca4db3ce117caca897696e from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35734#comment:18>
Reply all
Reply to author
Forward
0 new messages