id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 27808 Nested ArrayField with nullable base field generates invalid SQL Josef Kolář "When I have model {{{#!python class NestedNullableIntegerArrayModel(PostgreSQLModel): field = ArrayField(ArrayField(models.IntegerField(null=True))) }}} and trying to save data {{{#!python NestedNullableIntegerArrayModel(field=[[None, None], [None, None]]).save() }}} and Django generates {{{#!sql INSERT INTO ""postgres_tests_nestednullableintegerarraymodel"" (""field"") VALUES (%s) RETURNING ""postgres_tests_nestednullableintegerarraymodel"".""id"" }}} with expectable params {{{#!python ([[None, None], [None, None]], ) }}} and this query fails in postgres on {{{ ERROR: column ""field"" is of type integer[] but expression is of type text[] LINE 1: ...estednullableintegerarraymodel"" (""field"") VALUES (ARRAY['{NU... ^ HINT: You will need to rewrite or cast the expression. }}} **But, if I use one of values is not None, model is saved successfully:** {{{#!python NestedNullableIntegerArrayModel(field=[[None, None], [None, 42]]).save() }}} " Bug new contrib.postgres 1.9 Normal Unreviewed 0 0 0 0 0 0