AssertionError: Index too long for multiple database support. Is
self.suffix longer than 3 characters?
--
Ticket URL: <https://code.djangoproject.com/ticket/27935>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
There are no tests for auto-generated index names as there are for
GinIndex:
https://github.com/django/django/blob/master/tests/postgres_tests/test_indexes.py#L61-L64
--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:1>
* cc: felisiak.mariusz@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:2>
Comment (by Mads Jensen):
The current model wasn't actually enough to trigger a failure for the
auto-generated name as the length of the indexed field is only 5
characters.
Either changing `suffix = brin` to `suffix = `brn`, or removing a
character from the hash so it's just five characters. Probably the first
is better?
{{{#!python
def test_name_auto_generation_fail(self):
# name of field must be at least 7 characters long to get to 30
characters
index = BrinIndex(fields=['datetimes'])
index.set_name_with_model(DateTimeArrayModel)
self.assertEqual(index.name, 'postgres_te_datetim_b1e2ca_brn')
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:3>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/8171 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:4>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:5>
* status: new => closed
* owner: (none) => Tim Graham <timograham@…>
* resolution: => fixed
Comment:
In [changeset:"82bb4e684f9d0e5939cb0596c249954df0888e2d" 82bb4e68]:
{{{
#!CommitTicketReference repository=""
revision="82bb4e684f9d0e5939cb0596c249954df0888e2d"
Fixed #27935 -- Fixed crash with BrinIndex name > 30 characters.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"0b93a992e50ebe455e46d261cb6a741bba1ad76e" 0b93a992]:
{{{
#!CommitTicketReference repository=""
revision="0b93a992e50ebe455e46d261cb6a741bba1ad76e"
[1.11.x] Fixed #27935 -- Fixed crash with BrinIndex name > 30 characters.
Backport of 82bb4e684f9d0e5939cb0596c249954df0888e2d from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:7>
* status: closed => new
* has_patch: 1 => 0
* resolution: fixed =>
* stage: Ready for checkin => Accepted
Comment:
Florian pointed out on IRC that in a mixed database setup,
`connection.ops.max_name_length()` won't necessarily be a PostgreSQL
connection. Maybe that could use the
`db.backends.postgresql.operations.DatabaseOperations` class instead.
--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:8>
Comment (by Tim Graham <timograham@…>):
In [changeset:"2867b7eb4b8477710f11707d4b975db10e5f91a7" 2867b7eb]:
{{{
#!CommitTicketReference repository=""
revision="2867b7eb4b8477710f11707d4b975db10e5f91a7"
Refs #27935 -- Fixed BrinIndex.max_name_length if a project's default
database isn't PostgreSQL.
Thanks Florian Apolloner for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:9>
Comment (by Tim Graham <timograham@…>):
In [changeset:"40b843488a1c4f2fab8e3ab895718a867cc00133" 40b84348]:
{{{
#!CommitTicketReference repository=""
revision="40b843488a1c4f2fab8e3ab895718a867cc00133"
[1.11.x] Refs #27935 -- Fixed BrinIndex.max_name_length if a project's
default database isn't PostgreSQL.
Thanks Florian Apolloner for the report.
Backport of 2867b7eb4b8477710f11707d4b975db10e5f91a7 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:10>
* status: new => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/27935#comment:11>