#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.