mirror of
https://github.com/django/django.git
synced 2025-08-17 17:20:38 +00:00
[5.2.x] Fixed #36107 -- Adjusted UNNEST bulk_create strategy to opt-out sized arrays.
The array fields opt-out heuristic failed to account for sized arrays.
Note that we keep relying on db_type as opposed to performing an ArrayField
instance check against the column's field as there could be other
implementations of model fields that use Postgres arrays to store the
optimization must be disabled for all of them.
Refs #35936.
Thanks Claude Paroz for the report and test.
Backport of 22fc151bb8
from main.
This commit is contained in:
parent
dab04b89af
commit
ad6bca92a8
4 changed files with 38 additions and 1 deletions
|
@ -64,6 +64,10 @@ class DateTimeArrayModel(PostgreSQLModel):
|
|||
times = ArrayField(models.TimeField())
|
||||
|
||||
|
||||
class WithSizeArrayModel(PostgreSQLModel):
|
||||
field = ArrayField(models.FloatField(), size=3)
|
||||
|
||||
|
||||
class NestedIntegerArrayModel(PostgreSQLModel):
|
||||
field = ArrayField(ArrayField(models.IntegerField()))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue