Does Django care about max_query_params? [feature request]

30 views
Skip to first unread message

Ilya Gurov

unread,
Jun 27, 2022, 10:49:40 AMJun 27
to Django users
Hi, all!

Gotta problem with the number of query params. We're using a backend, which connects to a cloud database, and at some point we suddenly started getting such an error:

Number of parameters in query exceeds the maximum allowed limit of 950

Appearing on this step:

django/django/contrib/auth/management/__init__.py", line 83, in create_permissions
Permission.objects.using(using).bulk_create(perms)

950 query params is the max number for our backend, and we set the DatabaseFeatures.max_query_params to 900. Still, it looks like Django doesn't care.

Because of this all of our tests stopped working, bringing a lot of inconveniences during development. Seems to me that it should be fixed on Django side, centralized, 'cause it's unlikely we're the only who met and will meet the problem in future.

Jason

unread,
Jun 28, 2022, 3:36:08 AMJun 28
to Django users

What db are you using? This might also be an issue for your db connector lib 

Ilya Gurov

unread,
Jul 5, 2022, 6:13:32 AMJul 5
to Django users
It's Cloud Spanner. We're using `django_spanner` as a 3rd party connector: https://github.com/googleapis/python-spanner-django

Jason

unread,
Jul 5, 2022, 6:47:15 AMJul 5
to Django users
https://github.com/googleapis/python-spanner-django/pull/774

seems like an open PR is addressing this.
Reply all
Reply to author
Forward
0 new messages