#19441: No Postgres _like index when unique=True
-------------------------------------+-------------------------------------
     Reporter:  dyve                 |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:  fixed
     Severity:  Normal               |             Triage Stage:  Ready for
     Keywords:  postgresql           |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by dyve):

 Claude, this would be perfect. The explanation you added (unique=True
 implies db_index=True on all occasions) says it all, and it very elegant.

  The only "added weight" you collect by solving it like this is the
 creation of like-indexes on postgresql when the field is used as a unique
 identifier and not meant for like searching, The like indexes  would be
 created but never used. I think this is not a problem, as it is far more
 important to have a unified way that Django works (again, unique=True
 implies db_index=True) than to take different database vendors into
 account when deciding when or not to add db_index=True.

 To but it briefly, I'd be in favor of submitting this patch as the final
 solution for this issue.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19441#comment:11>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to