#13441: maximum name length not specified for PostgreSQL
------------------------------------------+---------------------------------
 Reporter:  aball                         |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  SVN       
 Keywords:                                |       Stage:  Unreviewed
Has_patch:  1                             |  
------------------------------------------+---------------------------------
 Neither the postgresql nor postgresql_psycopg2 database backends implement
 the DatabaseOperations.max_name_length() method.  Issue #13434 contains
 changeset ([13040]) that implements the corresponding method for the MySQL
 database backend, thus preventing the BaseDatabaseCreation class's
 sql_indices_for_field() method from trying to make indices in MySQL with
 names that are too long.  The same fix should work for PostgreSQL, given a
 suitable max_name_length() implementation.

 Generally, the maximum identifier length in PostgreSQL is 63, but it may
 be changed by recompiling PostgreSQL with the NAMEDATALEN macro in
 src/include/pg_config_manual.h changed.  Note that the maximum identifier
 length is always one less than the value of that macro.

 I've made a patch that just returns 63 in both PostgreSQL backends, with a
 docstring explaining about the possibility of recompiling PostgreSQL and
 suggesting that someone who has recompiled PostgreSQL and wants a
 different maximum name length could make their own database backend by
 inheriting almost everything from one of the existing backends and
 overridding the max_name_length() method in the database operations class.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13441>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to