Changes between Initial Version and Version 1 of Ticket #27808


Ignore:
Timestamp:
Feb 4, 2017, 3:47:44 PM (7 years ago)
Author:
Josef Kolář
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27808 – Description

    initial v1  
    66and trying to save data
    77{{{#!python
    8 instance = NestedNullableIntegerArrayModel(field=[[None, None], [None, None]])
    9     instance.save()
     8NestedNullableIntegerArrayModel(field=[[None, None], [None, None]]).save()
    109}}}
    1110and Django generates
    12 {{{#!SQL
     11{{{#!sql
    1312INSERT INTO "postgres_tests_nestednullableintegerarraymodel" ("field") VALUES (%s) RETURNING "postgres_tests_nestednullableintegerarraymodel"."id"
    1413}}}
    15 
     14with expectable params
     15{{{#!python
     16([[None, None], [None, None]], )
     17}}}
     18and this query fails in postgres on
     19{{{
     20ERROR:  column "field" is of type integer[] but expression is of type text[]
     21LINE 1: ...estednullableintegerarraymodel" ("field") VALUES (ARRAY['{NU...
     22                                                             ^
     23HINT:  You will need to rewrite or cast the expression.
     24}}}
     25**But, if I use one of values is not None, model is saved successfully:**
     26{{{#!python
     27NestedNullableIntegerArrayModel(field=[[None, None], [None, 42]]).save()
     28}}}
Back to Top