﻿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
5258	SlugField not getting an index if attribute of unique=True also set	odonian@…	Adrian Holovaty	"I'm using Postgres 8.2 and I'm noticing that for all Django
models where I have a SlugField, the database index seems to be
missing where I also set unique=True in the SlugField definition.  By
default, SlugField has db_index=True, according to the docs, and I do
see an index for SlugFields where I didn't set unique=True. i.e.

foo = models.SlugField()      ----> index is present in Postgres, as
expected

bar = models.SlugField(unique=True)   ---> index is not present in
Postgres

I also have other attributes on the SlugField, like maxlength,
blank=True and null=True, but the only consistent difference between
the SlugFields where an index is not present automatically vs those
that are seems to be the attribute unique=True.  Manually creating the
index works fine.  "		closed	Database layer (models, ORM)	dev		worksforme	SlugField, unique, index, PostgreSQL		Unreviewed	0	0	0	0	0	0
