﻿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
27708	Relation between tables in different schemas with big names	felipeps	nobody	"I'm using Django 1.9.7 with Postgresql.

When I try to migrate  a relation between two tables in different schemas, for example: a table named ''**product**'', which is in a schema named ''**dataflex**'' and another table named ''**client_product_sale_stc**'' in another schema.

I got this error:

----

django.db.utils.ProgrammingError: ERRO:  syntax error at or near ""dataflex""
LINE 1: ...CONSTRAINT ""client_product_setor_id_52aad07a_fk_""dataflex""....

----

After sometime trying to figure It out a solution for this problem, I tried to change the schemas's name to just ''**df**'' instead of ''**dataflex**'' and It worked perfectly.

I also tried to decreased table's name size and It worked just like when I decreased schema's name size, so It seems to be a problem with big constraints names.

I'm using the following syntax:

db_table = '""dataflex"".""product""'

**setor_id** is the name of the field of the relation in client_product_sale_stx model/table. 
product model/table does not have a field for the relation.

"	Bug	new	Migrations	1.9	Normal		different schema relation		Unreviewed	0	0	0	0	0	0
