mirror of
https://github.com/django/django.git
synced 2025-08-18 09:40:51 +00:00
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.
This commit is contained in:
parent
f5772de696
commit
22fc151bb8
4 changed files with 38 additions and 1 deletions
|
@ -167,6 +167,28 @@ class Migration(migrations.Migration):
|
|||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="WithSizeArrayModel",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.AutoField(
|
||||
verbose_name="ID",
|
||||
serialize=False,
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
),
|
||||
),
|
||||
(
|
||||
"field",
|
||||
ArrayField(models.FloatField(), size=2, null=True, blank=True),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"required_db_vendor": "postgresql",
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="NullableIntegerArrayModel",
|
||||
fields=[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue