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 3607,db_columns problems,Mario Gonzalez,Adrian Holovaty,"*My backend is PostgreSQL* In my models.py file I've got a class called ""Respuesta_satisfaccion_general"" (30 chars) and the PK is defined by a db_column attr: db_column=id_respuesta_satisfaccion_general (33 chars). So the sequence name is going to be ""otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_general_seq"", it's a long string: 63 characters. Bad news, it fails: ""relation doesn't exists"". A very little snipet: {{{ class Respuesta_satisfaccion_general(models.Model): id_respuesta_satisfaccion_general= models.AutoField(primary_key=True, db_column=""id_respuesta_satisfaccion_general"") [...] }}} I first place I thougth it was a django problem, '''however''' I tested on psql {{{ SELECT currval("" otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_general_seq ""); NOTICE: el identificador « otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_general_seq » se truncará a « otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_» ERROR: no existe la columna « otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_» NOTICE translation: ""otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_general_seq"" will be truncated to ""otec_respuesta_satisfaccion_general_id_respuesta_satisfaccion_"" }}} So, I think must be a validation before create tables, well before generate SQL code. How did a ""fixed""? I changed db_column content to something shorter. ",,closed,"Database layer (models, ORM)",dev,,duplicate,,,Unreviewed,0,0,0,0,0,0