On Friday, April 29, 2016 at 2:16:45 AM UTC-7, Anssi Kääriäinen wrote:
>
> If you really, really want an unique index that allows just a single 
> value, you might want to try unique index on (a, b, c) where c is not 
> null, and another unique index on (a, b) where c is null. That might 
> give the results you are looking for, though I haven't tested this. 
>

What I'm suggesting is a way to express that index within Django, similar 
to unique_together (and perhaps a warning in the docs, given the frequency 
is comes up on stackoverflow.)

I see now that since multi column indexes are an extension of a single 
column index, it makes sense -- you'd never want a single column index to 
only have one null value.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c3b2e562-1e1e-4efd-89d2-eb82c4eb13da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to