﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36880	Postgres hash exclusion constraints are not considered totally unique	Tilman Koschnick	Karthik	"Hi, 

with Postgres, a hash index can be used as an exclusion constraint, functioning the same way a unique btree based constrained. Support for this has recently been merged to Django: [https://code.djangoproject.com/ticket/36827]

Using this on a USERNAME_FIELD can be good for index size and performance. Currently, the auth system checks doesn't detect a hash exclusion constraint as a viable option though:

{{{
account.User: (auth.E003) 'User.email' must be unique because it is named as the 'USERNAME_FIELD'.
}}}

The attached patch enhances the check to consider hash constraints as well.

Cheers, Til"	Bug	assigned	Database layer (models, ORM)	dev	Normal			Tilman Koschnick Karthik	Accepted	1	0	0	1	0	0
