django.db.utils.DataError: missing dimension value
It seems that the literal [] is being sent through to the database, rather
than the postgres-speak for an empty array: '{}'
It's the same issue as seen elsewhere on the internet when dealing with
postgres arrays:
https://github.com/ecometrica/django-dbarray/issues/2
--
Ticket URL: <https://code.djangoproject.com/ticket/22962>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Oh, it was an undimensioned array: not sure if that's important.
--
Ticket URL: <https://code.djangoproject.com/ticket/22962#comment:1>
Comment (by schinckel):
In ArrayField.get_prep_value(self,value), adding:
if value == '[]':
value = '{}'
makes it work as expected.
--
Ticket URL: <https://code.djangoproject.com/ticket/22962#comment:2>
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/22962#comment:3>
Comment (by mjtamlyn):
PR: https://github.com/django/django/pull/2925
Not sure why I am getting a string from the migration runner, seems a
little strange. Nonetheless it works now.
--
Ticket URL: <https://code.djangoproject.com/ticket/22962#comment:4>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/22962#comment:5>
* status: new => closed
* owner: => Marc Tamlyn <marc.tamlyn@…>
* resolution: => fixed
Comment:
In [changeset:"ef9f109013adc6e140c1a71d874aa88e893657b7"]:
{{{
#!CommitTicketReference repository=""
revision="ef9f109013adc6e140c1a71d874aa88e893657b7"
Fixed #22962 -- Default values for ArrayField with migrations.
Fields normally try to force the default value to a string. As
translatable strings are not valid default values for ArrayField, we can
remove this behaviour which was causing issues with some migrations.
Thanks to @schinckel for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22962#comment:6>
Comment (by Markus Holtermann <info@…>):
In [changeset:"b06935a486e633e9732bce2bc5f796eb437b2531"]:
{{{
#!CommitTicketReference repository=""
revision="b06935a486e633e9732bce2bc5f796eb437b2531"
Refs #22962 -- Made test case use non-conflicting table names
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22962#comment:7>
Comment (by Markus Holtermann <info@…>):
In [changeset:"45d93baf518218c39b70fbc1eb35e9b53f66cf98"]:
{{{
#!CommitTicketReference repository=""
revision="45d93baf518218c39b70fbc1eb35e9b53f66cf98"
[1.8.x] Refs #22962 -- Made test case use non-conflicting table names
Backport of b06935a486e633e9732bce2bc5f796eb437b2531 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22962#comment:8>
* status: closed => new
* resolution: fixed =>
Comment:
This is happening again.
{{{
django.db.utils.DataError: malformed array literal: ""
DETAIL: Array value must start with "{" or dimension information.
}}}
Checked on 1.10 and 1.11rc1.
--
Ticket URL: <https://code.djangoproject.com/ticket/22962#comment:9>
Comment (by Matthew Schinckel):
I'm not sure it's exactly the same issue: it's a different error message,
for one.
--
Ticket URL: <https://code.djangoproject.com/ticket/22962#comment:10>
* status: new => closed
* resolution: => fixed
Comment:
Reopened in error
--
Ticket URL: <https://code.djangoproject.com/ticket/22962#comment:11>