#18117: Django 1.4 Trouble Creating Large Numbers of Tables with SQLite -------------------------------+--------------------------------- Reporter: rball@… | Owner: nobody Type: Bug | Status: new Component: Uncategorized | Version: 1.4 Severity: Normal | Keywords: SQLite, max columns Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------+--------------------------------- After upgrading from Django 1.3 to Django 1.4 and running syncdb I get the following error message (with traceback):
Traceback (most recent call last): File "./manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/core/management/__init__.py", line 443, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/core/management/__init__.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/core/management/base.py", line 196, in run_from_argv self.execute(*args, **options.__dict__) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/core/management/base.py", line 232, in execute output = self.handle(*args, **options) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/core/management/base.py", line 371, in handle return self.handle_noargs(**options) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/core/management/commands/syncdb.py", line 110, in handle_noargs emit_post_sync_signal(created_models, verbosity, interactive, db) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/core/management/sql.py", line 189, in emit_post_sync_signal interactive=interactive, db=db) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/dispatch/dispatcher.py", line 172, in send response = receiver(signal=self, sender=sender, **named) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/contrib/auth/management/__init__.py", line 54, in create_permissions auth_app.Permission.objects.bulk_create(objs) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/db/models/manager.py", line 140, in bulk_create return self.get_query_set().bulk_create(*args, **kwargs) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/db/models/query.py", line 410, in bulk_create self.model._base_manager._insert(objs, fields=fields, using=self.db) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/db/models/manager.py", line 203, in _insert return insert_query(self.model, objs, fields, **kwargs) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/db/models/query.py", line 1576, in insert_query return query.get_compiler(using=using).execute_sql(return_id) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/db/models/sql/compiler.py", line 910, in execute_sql cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/db/backends/util.py", line 40, in execute return self.cursor.execute(sql, params) File "/usr/local/lib/python2.7/dist- packages/Django-1.4-py2.7.egg/django/db/backends/sqlite3/base.py", line 337, in execute return Database.Cursor.execute(self, query, params) django.db.utils.DatabaseError: too many SQL variables After doing some research I discovered that this error message is frequently related to trying to create more columns than the sqlite configuration file is set to allow (2000 by default, see http://www.sqlite.org/limits.html). I don't have any one table with more than 2000 columns but all the tables together have well over that amount. It seems this may be a bug and I haven't seen anyone else mention this as a problem. When I reduce the number of tables in my models.py to well below 2000 the models are all created just fine. -- Ticket URL: <https://code.djangoproject.com/ticket/18117> 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.