﻿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
19750	"Postgres conflict on CREATE INDEX: ""relation exists"""	pricco@…		"The syncdb index creation fails on postgres when a db_table name is equal to the union of a db_table name and a inner foreign key column name.

`<db_table>_id == <db_table>_<fk_column>_id`

{{{
class OrganizationType(models.Model):

    id = models.CharField(max_length=1, primary_key=True)

    class Meta:
        db_table = 'organization_type'

class Organization(models.Model):

    type = models.ForeignKey(OrganizationType)
    
    class Meta:
        db_table = 'organization'

}}}

`<organization_type>_id == <organization>_<type>_id`

Exception:

{{{
DatabaseError: relation ""organization_type_id_like"" already exists
}}}
"	Bug	closed	Database layer (models, ORM)	1.5-beta-1	Normal	fixed			Accepted	1	0	0	1	0	0
