[Django] #33872: Deprecate CICharField, CIEmailField, CITextField.

38 views
Skip to first unread message

Django

unread,
Jul 28, 2022, 7:02:57 AM7/28/22
to django-...@googlegroups.com
#33872: Deprecate CICharField, CIEmailField, CITextField.
------------------------------------------------+------------------------
Reporter: Mariusz Felisiak | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.postgres | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Django 3.2+ supports `db_collation` for `CharField` and `TextField` (see
#31777) along with migration operations (`CreateCollation()`,
`RemoveCollation()`) and the database function `Collate()` (see #21181).
Moreover CI fields and the entire `citext` module are discouraged since
[https://www.postgresql.org/docs/12/citext.html PostgreSQL 12] (which is
the minimum version supported by Django 4.2+) in favor of collations. I
think it's time to deprecate CI fields from the `contrib.postgres` in
favor of `CharField` and `TextField` with case insensitive collations.

Related [https://groups.google.com/g/django-
developers/c/nDMnO98nexY/m/cw93-R1bBQAJ discussion] on the django-
developers mailing list.

--
Ticket URL: <https://code.djangoproject.com/ticket/33872>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 28, 2022, 7:03:37 AM7/28/22
to django-...@googlegroups.com
#33872: Deprecate CICharField, CIEmailField, CITextField.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
Type: | Felisiak
Cleanup/optimization | Status: assigned
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: (none) => Mariusz Felisiak
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/33872#comment:1>

Django

unread,
Jul 28, 2022, 7:10:41 AM7/28/22
to django-...@googlegroups.com
#33872: Deprecate CICharField, CIEmailField, CITextField.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
Type: | Felisiak
Cleanup/optimization | Status: assigned
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution:
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 Carlton Gibson):

* stage: Unreviewed => Accepted


Comment:

Accepting based on discussion (+3:-0 I think)

Points were to ensure we document a migration, and perhaps how to avoid
needing the CI field ("...put an index on UPPER and make sure you always
use iexact.")

--
Ticket URL: <https://code.djangoproject.com/ticket/33872#comment:2>

Django

unread,
Jul 29, 2022, 5:21:02 AM7/29/22
to django-...@googlegroups.com
#33872: Deprecate CICharField, CIEmailField, CITextField.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
Type: | Felisiak
Cleanup/optimization | Status: assigned
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/15891 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/33872#comment:3>

Django

unread,
Aug 2, 2022, 5:56:56 AM8/2/22
to django-...@googlegroups.com
#33872: Deprecate CICharField, CIEmailField, CITextField.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
Type: | Felisiak
Cleanup/optimization | Status: assigned
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33872#comment:4>

Django

unread,
Aug 3, 2022, 5:43:42 AM8/3/22
to django-...@googlegroups.com
#33872: Deprecate CICharField, CIEmailField, CITextField.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
Type: | Felisiak
Cleanup/optimization | Status: closed
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"cb791a2540c289390b68a3ea9c6a79476890bab2" cb791a25]:
{{{
#!CommitTicketReference repository=""
revision="cb791a2540c289390b68a3ea9c6a79476890bab2"
Fixed #33872 -- Deprecated
django.contrib.postgres.fields.CIText/CICharField/CIEmailField/CITextField.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33872#comment:5>

Django

unread,
Apr 12, 2023, 5:31:10 AM4/12/23
to django-...@googlegroups.com
#33872: Deprecate CICharField, CIEmailField, CITextField.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
Type: | Felisiak
Cleanup/optimization | Status: closed
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage:
| Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Maron):

* stage: Ready for checkin => Unreviewed


Comment:

In case my mailing list comment gets lost, I make this as unreviewed and
leave a copy here:

Hi there,

I am sorry that I missed this in the alpha. But to the best of my
knowledge, CITEXT and non-deterministic collations are not the same. They
don't support the same operations and their string comparison operations
are similar, yet not identical.
Furthermore, PostgreSQL doesn't discourage the use of CITEXT, but hints
towards a native alternative. That's maybe more than just a subtle
difference.

99% of all use-cases might be email, but even email LIKE-queries would be
affected (good for +-searches).

Unless we want to drop support for the CITEXT extension, collations might
not be a sufficient replacement.

I'd caution to revert the deprecation and keep support unless we make an
informed decision to drop CITEXT for a 3rd party integration.

Best
Joe!

--
Ticket URL: <https://code.djangoproject.com/ticket/33872#comment:6>

Django

unread,
Apr 12, 2023, 5:33:02 AM4/12/23
to django-...@googlegroups.com
#33872: Deprecate CICharField, CIEmailField, CITextField.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
Type: | Felisiak
Cleanup/optimization | Status: closed
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Unreviewed => Ready for checkin


Comment:

Please don't reopen/change closed tickets. If you want to report a bug,
create a separate ticket.

--
Ticket URL: <https://code.djangoproject.com/ticket/33872#comment:7>

Django

unread,
Sep 18, 2023, 4:12:53 PM9/18/23
to django-...@googlegroups.com
#33872: Deprecate CICharField, CIEmailField, CITextField.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
Type: | Felisiak
Cleanup/optimization | Status: closed
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"04eb1b4567c96ccb167c16a95ca12c336b0c791b" 04eb1b4]:
{{{
#!CommitTicketReference repository=""
revision="04eb1b4567c96ccb167c16a95ca12c336b0c791b"
Refs #33872 -- Removed
django.contrib.postgres.fields.CIText/CICharField/CIEmailField/CITextField.

Per deprecation timeline.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33872#comment:8>

Django

unread,
Aug 28, 2024, 12:47:30 PM8/28/24
to django-...@googlegroups.com
#33872: Deprecate CICharField, CIEmailField, CITextField.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
Type: | Felisiak
Cleanup/optimization | Status: closed
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Gavin Wahl):

I think this should be reverted, there is no consensus for this
deprecation on the mailing list: https://groups.google.com/g/django-
developers/c/nDMnO98nexY
--
Ticket URL: <https://code.djangoproject.com/ticket/33872#comment:9>

Django

unread,
Aug 28, 2024, 2:04:21 PM8/28/24
to django-...@googlegroups.com
#33872: Deprecate CICharField, CIEmailField, CITextField.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
Type: | Felisiak
Cleanup/optimization | Status: closed
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak):

It's no longer a deprecation,
`CIText`/`CICharField`/`CIEmailField`/`CITextField` have already been
removed in Django 5.1, and (as far as I'm aware) it's too late to change
this decision and add them back to the core. You can always use `django-
citext` if really need to use them.
--
Ticket URL: <https://code.djangoproject.com/ticket/33872#comment:10>
Reply all
Reply to author
Forward
0 new messages