Pertaining the 4.2.6 release's "recreate indexes" footnote

104 views
Skip to first unread message

Michael

unread,
Oct 10, 2023, 5:32:08 PM10/10/23
to Django developers (Contributions to Django itself)

> You may need to recreate indexes propagated to the database with Django 4.2 - 4.2.5 as they contain unnecessary ::text casting that is avoided as of this release.

This doesn't give much context or give any guidance on how best to handle this, whether Django could help, etc.

It also doesn't clarify why this is a "may need to" situation. Were Django versions 4.2-4.2.5 randomly doing this from time to time, or is this actually "you definitely do need to" situation; or is only relevant in specific scenarios?

My immediate thought is that any indexes on non-text fields, created with these versions, will be useless in ORM-based queries. If that's the case, this seems like a much bigger deal than the footnote would imply.

Thoughts on this?

אורי

unread,
Oct 10, 2023, 8:36:58 PM10/10/23
to django-d...@googlegroups.com
Hi,

I also think a more specific documentation as to how to fix this issue is required.

I usually upgrade Django about 6 months after the initial major release, which is this month. But because of this issue I decided to wait 2 more months.

Thanks,
Uri.


--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/e686415b-0c4b-4643-8d0f-707aa859992bn%40googlegroups.com.

Mariusz Felisiak

unread,
Oct 11, 2023, 2:29:58 AM10/11/23
to Django developers (Contributions to Django itself)
My immediate thought is that any indexes on non-text fields, created with these versions, will be useless in ORM-based queries. If that's the case, this seems like a much bigger deal than the footnote would imply.

I'm puzzled. Why you assumed that all non-string based fields are affected? Release note explicitly specifies what kind of indexes are affected:

Indexes "on string based fields (CharField, EmailField, TextField, CICharField, CIEmailField, and CITextField) used with the __isnull lookup on PostgreSQL".

Do you it's worth mentioning again after "You may need to recreate indexes.."? For example

"You may need to recreate indexes on string based fields (CharField, EmailField, TextField, CICharField, CIEmailField, and CITextField) used with the __isnull lookup propagated to the PostgreSQL database with Django 4.2 - 4.2.5, as they contain unnecessary ::text casting that is avoided as of this release."

Best,
Mariusz

Michael

unread,
Oct 11, 2023, 2:17:16 PM10/11/23
to Django developers (Contributions to Django itself)
Pardon, @Mariusz, I didn't mean to specify "non-text fields" - I had re-worded that sentence before posting.

Mariusz Felisiak

unread,
Oct 12, 2023, 12:09:13 AM10/12/23
to Django developers (Contributions to Django itself)
> Thoughts on this?

Documentation improvements are always welcome, you can send your proposition via GitHub PR.

Best,
Mariusz

Adam Johnson

unread,
Oct 12, 2023, 2:04:47 PM10/12/23
to Mariusz Felisiak, django-d...@googlegroups.com
I’ve created a PR with a suggested improvement: https://github.com/django/django/pull/17359 .
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages