summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/compiler.py
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:24:10 -0500
commitac9bdcabe10fb7ac0c7e9ebcd879f5e34bee776f (patch)
tree517bd72a81b32a1e0664a0b9a22cdd2c56a67356 /django/db/backends/postgresql/compiler.py
parent001c2f546b4053acb04f16d6b704f7b4fbca1c45 (diff)
[5.2.x] Fixed #36748 -- Filtered non-standard placeholders from UNNEST queries.
Backport of 5834643f43a767fe19f2c6d10217b204e7584ec8 from main.
Diffstat (limited to 'django/db/backends/postgresql/compiler.py')
-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 344773fb7a..dc2db148ae 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).