Skip to content

Commit

Permalink
Fixed #35734 -- Used JSONB_BUILD_OBJECT database function on PostgreS…
Browse files Browse the repository at this point in the history
…QL when using server-side bindings.

Regression in 81ccf92.
  • Loading branch information
john-parton authored and sarahboyce committed Sep 26, 2024
1 parent 5f0ed95 commit f22ff45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django/db/models/functions/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ def join(self, args):
)

def as_postgresql(self, compiler, connection, **extra_context):
if not connection.features.is_postgresql_16:
if (
not connection.features.is_postgresql_16
or connection.features.uses_server_side_binding
):
copy = self.copy()
copy.set_source_expressions(
[
Expand Down
3 changes: 3 additions & 0 deletions docs/releases/5.1.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ Bugfixes
* Fixed a regression in Django 5.1 that caused a crash when using the
PostgreSQL lookup :lookup:`trigram_similar` on output fields from ``Concat``
(:ticket:`35732`).

* Fixed a regression in Django 5.1 that caused a crash of ``JSONObject()``
when using server-side binding with PostgreSQL 16+ (:ticket:`35734`).

0 comments on commit f22ff45

Please sign in to comment.