{{{
pending_objects =
PostSchedule.objects.filter(subject__post_id__isnull=True).order_by("subject__published")[:3]
}}}
This query works as expected when using PostgreSQL as the backend database
with Django. When using MariaDB (`11.1.3-MariaDB`) however, said query
will receive an error:
{{{
django.db.utils.NotSupportedError: (1235, "This version of MariaDB doesn't
yet support 'LIMIT & IN/ALL/ANY/SOME subquery'")
}}}
I don't have a MySQL database to test whether this applies to MySQL as
well, but it's possible that this too applies for it.
Django's documentations on
[https://docs.djangoproject.com/en/4.2/topics/db/queries/#limiting-
querysets Limiting QuerySets] and
[https://docs.djangoproject.com/en/4.2/ref/databases/#mariadb-notes
MariaDB notes] does not seem to indicate that the **Limiting QuerySets**
feature should not be database platform agnostic.
I would also appreciate any pointers on how to still achieve a similar
enough outcome of limiting a QuerySet to a specified number when using
MariaDB (or other supported databases that is not PostgreSQL).
--
Ticket URL: <https://code.djangoproject.com/ticket/35053>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => duplicate
* easy: 1 => 0
Comment:
Duplicate of #10099.
> Django's documentations on Limiting QuerySets and MariaDB notes does
not seem to indicate that the Limiting QuerySets feature should not be
database platform agnostic.
We cannot document all database caveats, and the current error is clear
enough.
> I would also appreciate any pointers on how to still achieve a similar
enough outcome of limiting a QuerySet to a specified number when using
MariaDB (or other supported databases that is not PostgreSQL).
This is a support question, for which you should use
[https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
support channels].
--
Ticket URL: <https://code.djangoproject.com/ticket/35053#comment:1>