#14904: TextField with unique (or in unique_together) constraint breaks for
large
inputs in Postgres
-------------------------------------+-------------------------------------
Reporter: jorn | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: postgresql, index, | Triage Stage: Accepted
textfield |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Messer):
Have also observed this with Django 1.8 and postgres 9.3
I'm linking references for fixes / workarounds found in a quick search:
* http://stackoverflow.com/questions/20725671/how-to-truncate-column-in-
order-to-create-indexes
* https://www.postgresql.org/message-
id/AANLkTikG_nHARKr9qeQXpS7Q6QXgJvuFUi6Wxpd0o7H7%40mail.gmail.com
* https://www.postgresql.org/docs/current/static/indexes-opclass.html
At the moment, it looks like any workaround involves writing some raw SQL.
Digging through Django's code, indices are created by
django.db.backends.base.schema.BaseDatabaseSchemaEditor._sql_create_index()
That's pretty far outside the public API.
--
Ticket URL: <https://code.djangoproject.com/ticket/14904#comment:4>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/062.3eda9110bdf51ce2509a43717d1aa5b4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.