summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/compiler.py
diff options
context:
space:
mode:
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 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).