Changes between Initial Version and Version 1 of Ticket #27808
- Timestamp:
- Feb 4, 2017, 3:47:44 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27808 – Description
initial v1 6 6 and trying to save data 7 7 {{{#!python 8 instance = NestedNullableIntegerArrayModel(field=[[None, None], [None, None]]) 9 instance.save() 8 NestedNullableIntegerArrayModel(field=[[None, None], [None, None]]).save() 10 9 }}} 11 10 and Django generates 12 {{{#! SQL11 {{{#!sql 13 12 INSERT INTO "postgres_tests_nestednullableintegerarraymodel" ("field") VALUES (%s) RETURNING "postgres_tests_nestednullableintegerarraymodel"."id" 14 13 }}} 15 14 with expectable params 15 {{{#!python 16 ([[None, None], [None, None]], ) 17 }}} 18 and this query fails in postgres on 19 {{{ 20 ERROR: column "field" is of type integer[] but expression is of type text[] 21 LINE 1: ...estednullableintegerarraymodel" ("field") VALUES (ARRAY['{NU... 22 ^ 23 HINT: 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 27 NestedNullableIntegerArrayModel(field=[[None, None], [None, 42]]).save() 28 }}}