So if i add unique index to a column in PostgreSQL, do i need to do any other changes in the django itself ?
I am asking this because, MySQL have this functionality enabled by default without creating any special methods. On Monday, December 7, 2009 at 5:33:11 PM UTC+5:30, David De La Harpe Golden wrote: > > chefsmart wrote: > > By the way, right now I'm using a State.objects.get(name__iexact=name) > > in clean_name() method in a form subclass to prevent creation of case- > > insensitive duplicates. Just wondering if there is a built-in or > > better way. > > > > Well, in postgresql itself one can make a case insensitive unique > constraint using "functional index" functionality: > > create unique index app_state_lower_name_idx on app_state(lower(name)); > > as per: http://archives.postgresql.org/pgsql-general/2005-09/msg00842.php > > > I guess django's ORM would need some surgery to make it automagically > generate and manage such constraints though. > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/688c5ddb-9a1d-4b87-b0ea-f01eb7a7623a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.