Opened 6 years ago
Closed 6 years ago
#29962 closed Bug (invalid)
Queryset.explain(verbose=True) doesn't work on non-PostgreSQL backend
Reported by: | Mohd. Shafikur Rahman | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 2.1 |
Severity: | Normal | Keywords: | |
Cc: | shafikshaon@…, Mohd. Shafikur Rahman | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
print(User.objects.filter(is_active=True).explain(verbose=True)) if you run this, this may throw an exception
- expect using but it doesn't describe in documentation
- return self.query.explain(using=self.db, format=format, options)
- raise ValueError('Unknown options: %s' % ', '.join(sorted(options.keys())))
ValueError: Unknown options: verbose
Doc link: https://docs.djangoproject.com/en/2.1/ref/models/querysets/#explain
Change History (2)
comment:1 by , 6 years ago
Cc: | added |
---|---|
Component: | Documentation → Database layer (models, ORM) |
comment:2 by , 6 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Summary: | queryset explain() doesn't work with verbose=True → Queryset.explain(verbose=True) doesn't work on non-PostgreSQL backend |
Note:
See TracTickets
for help on using tickets.
As documented
explain()
accepts backend specific options and the theverbose=True
option is PostgreSQL specific.I managed to get the exact same error when trying to use
verbose=True
with SQLite, which I assume is what you tried doing there, and get a verbose output on PostgreSQL when using the same option.In the future please use TicketClosingReasons/UseSupportChannels to confirm your issue is a legitimate bug before filling a ticket.