summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorChris Wesseling <chris@maykinmedia.nl>2025-11-20 15:01:14 +0100
committerJacob Walls <jacobtylerwalls@gmail.com>2025-11-20 17:23:30 -0500
commit161e54348577ee9756b3766ab363596ab880560f (patch)
tree77cfd6348cb4d3e8f4bcc0538105739f7b9a94ac /django
parentb72ee77f6b98649c23e3b52746cd64f08c5d7137 (diff)
[6.0.x] Fixed #36748 -- Filtered non-standard placeholders from UNNEST queries.
Backport of 5834643f43a767fe19f2c6d10217b204e7584ec8 from main.
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/postgresql/compiler.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/compiler.py b/django/db/backends/postgresql/compiler.py
index a07ae3ea92..48d0ccfd9d 100644
--- a/django/db/backends/postgresql/compiler.py
+++ b/django/db/backends/postgresql/compiler.py
@@ -36,6 +36,11 @@ class SQLInsertCompiler(BaseSQLInsertCompiler):
# Lack of fields denote the usage of the DEFAULT keyword
# for the insertion of empty rows.
or any(field is None for field in fields)
+ # Field.get_placeholder takes value as an argument, so the
+ # resulting placeholder might be dependent on the value.
+ # in UNNEST requires a single placeholder to "fit all values" in
+ # the array.
+ or any(hasattr(field, "get_placeholder") for field in fields)
# Fields that don't use standard internal types might not be
# unnest'able (e.g. array and geometry types are known to be
# problematic).