mirror of
https://github.com/django/django.git
synced 2025-03-13 02:40:47 +00:00
[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.
This commit is contained in:
parent
9e146b27ad
commit
22bce642a9
@ -175,7 +175,10 @@ class JSONObject(Func):
|
||||
)
|
||||
|
||||
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(
|
||||
[
|
||||
|
@ -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`).
|
||||
|
Loading…
x
Reference in New Issue
Block a user