#35194: Postgres 16.2 with _iexact leads to IndeterminateCollation
-------------------------------------+-------------------------------------
Reporter: Aldalen | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution: needsinfo
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* cc: Simon Charette (added)
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
Re-opening as a release blocker for 5.0 at it's a bug in a new feature
(`GeneratedField`) after some sleuthing on #35368.
The culprit is [https://www.postgresql.org/docs/release/15.6/ this change
Postgres >= 12.18, 13.14, 14.11, 15.6, 16.2 released on 2024-02-08].
> Fix function volatility checking for GENERATED and DEFAULT expressions
(Tom Lane)
>
> These places could fail to detect insertion of a volatile function
default-argument expression, or decide that a polymorphic function is
volatile although it is actually immutable on the datatype of interest.
**This could lead to improperly rejecting or accepting a GENERATED clause,
or to mistakenly applying the constant-default-value optimization in ALTER
TABLE ADD COLUMN**.
In essence the problem seems similar to #34955 as `UPPER` can return
different value depending on the collation and thus is not immutable per-
se?
I've tried to come up with a workaround but I'm not sure what should be
done. The following doesn't work either
`UPPER("text" COLLATE "C") COLLATE "C" = UPPER('test' COLLATE "C") COLLATE
"C"`
so it's possible there might be a bug on the Postgres side as well? In all
cases keeping this ticket open should bring visibility to the issue.
A work around in the mean time is likely to use explicit collations
--
Ticket URL: <https://code.djangoproject.com/ticket/35194#comment:4>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018ecf63d0bc-1a66d58c-77a4-4eea-92ba-b6bbfe097a1e-000000%40eu-central-1.amazonses.com.