#34898: Adding non-deterministic collations to unique CharFields crashes on
PostgreSQL.
-------------------------------------+-------------------------------------
     Reporter:  Mariusz Felisiak     |                    Owner:  Tom
                                     |  Carrick
         Type:  Bug                  |                   Status:  assigned
    Component:  Migrations           |                  Version:  4.2
     Severity:  Normal               |               Resolution:
     Keywords:  PostgreSQL           |             Triage Stage:  Accepted
  collation                          |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tom Carrick):

 I looked into it a bit.

 I think handling this in the `schema` module is a really bad idea, as we
 would be dropping and creating an index or constraint without the user's
 knowledge. I don't see another way to handle it.

 The next option is to detect this when running `makemigrations`. I know
 very little about how `makemigrations` works so I may be totally wrong
 here but it seems like at the moment it doesn't really know anything about
 the database state. If we were to fix this bug there, we'd have to add a
 query to determine if the collation is deterministic. It would also need
 to have some knowledge of Postgres that seems not to be known anywhere
 else in this part of the code.

 So I again come back to this: I think we should document this and not try
 to fix it in code, and perhaps also further discourage use of
 `unique=True` and `db_index=True`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34898#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018b81d9b298-d08a68f2-5875-42f3-ace9-1a20917f70b1-000000%40eu-central-1.amazonses.com.

Reply via email to