#18218: get_table_list in postgresql introspection is unordered -------------------------------------+------------------------------------- Reporter: claudep | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: SVN (models, ORM) | Resolution: Severity: Normal | Triage Stage: Accepted Keywords: introspection | Needs documentation: 0 Has patch: 1 | Patch needs improvement: 0 Needs tests: 0 | UI/UX: 0 Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by akaariai): The patch does not work correctly on my Oracle setup. I get this error: {{{ Traceback (most recent call last): File "/home/akaariai/Programming/django/tests/regressiontests/introspection/tests.py", line 25, in _inner return func(*args, **kwargs) File "/home/akaariai/Programming/django/tests/regressiontests/introspection/tests.py", line 43, in test_table_names self.assertEqual(tl, sorted(tl)) AssertionError: Lists differ: [u'auth_group', u'auth_group_p... != [u'auth_group', u'auth_group_p... First differing element 7: django_comments django_comment_flags [u'auth_group', u'auth_group_permissions', u'auth_permission', u'auth_user', u'auth_user_groups', u'auth_user_user_permissions', u'django_admin_log', + u'django_comment_flags', u'django_comments', - u'django_comment_flags', u'django_content_type', u'django_flatpage', u'django_flatpage_sites', u'django_ixn_test_table', u'django_redirect', u'django_session', u'django_site', u'inspectdb_digitsincolumnname', u'inspectdb_message', u'inspectdb_people', u'inspectdb_peopledata', u'inspectdb_peoplemoredata', u'introspection_article', u'introspection_reporter'] }}} The reason for the error seems to be that Oracle sorts '_' and 's' characters differently than Python. In general the sort order of the database might be different than the sort order of Python. A good enough fix for this case is to check just one pair of tables, hopefully a pair which is incorrectly sorted without the patch, but correctly sorted with the patch. There are a couple of other Oracle tests failing already, but adding more isn't a good way forward. BTW In comment:1 I meant to say that the model order created by inspectdb is altered (a positive side-effect), not that model creation order is altered. I managed to write the wrong thing there... -- Ticket URL: <https://code.djangoproject.com/ticket/18218#comment:3> Django <https://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 django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.