Deprecate CICharField, CIEmailField, CITextField

2022-01-25 Thread Mariusz Felisiak

Hi y'all,

    Django 3.2+ supports "db_collation" [1] for "CharField" and 
"TextField" along with migration operations ("CreateCollation()", 
"RemoveCollation") and the database function "Collate()" [3]. Moreover 
CI fields and the entire "citext" module are discouraged since 
PostgreSQL 12 [4] 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 (and remove them in Django 
5.0).


Best,
Mariusz

[1] https://code.djangoproject.com/ticket/31777
[2] https://code.djangoproject.com/ticket/32046
[3] https://code.djangoproject.com/ticket/21181
[4] https://www.postgresql.org/docs/12/citext.html

--
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-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/833bb13b-3db1-f35b-3d51-a2a4671b45a9%40gmail.com.


Re: Deprecate CICharField, CIEmailField, CITextField

2022-01-25 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
My initial concern was around the minimum PostgreSQL version that Django
5.0 will support. According to
https://en.wikipedia.org/wiki/PostgreSQL#Release_history , PostgreSQL 10 is
supported until 2022-11-10 , and version 11 until 2023-11-09. With Django
5.0 expected in 2024-01, it should be fine to deprecate the CI fields for
removal in Django 5.0. Users on old PostgreSQL versions can manage the
deprecation warning until they upgrade.

So +1 from me.

On Tue, 25 Jan 2022 at 12:39, Mariusz Felisiak 
wrote:

> Hi y'all,
>
> Django 3.2+ supports "db_collation" [1] for "CharField" and
> "TextField" along with migration operations ("CreateCollation()",
> "RemoveCollation") and the database function "Collate()" [3]. Moreover CI
> fields and the entire "citext" module are discouraged since PostgreSQL 12
> [4] 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 (and remove them in Django 5.0).
>
> Best,
> Mariusz
>
> [1] https://code.djangoproject.com/ticket/31777
> [2] https://code.djangoproject.com/ticket/32046
> [3] https://code.djangoproject.com/ticket/21181
> [4] https://www.postgresql.org/docs/12/citext.html
>
> --
> 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-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/833bb13b-3db1-f35b-3d51-a2a4671b45a9%40gmail.com
> 
> .
>

-- 
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-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM1woKitn3cd7CQ%3DYLuPcHuR_U0vATScjdQLvsvC7JtWEQ%40mail.gmail.com.


Re: Deprecate CICharField, CIEmailField, CITextField

2022-01-25 Thread Paolo Melchiorre
Hi Mariusz,

I agree with you on deprecating and then removing CI fields.

I only would suggest adding some examples of migrations from CI fields
to collations in the deprecation notes to help users to easily
migrate.

So +1 for me too.

Ciao,
Paolo

On Tue, Jan 25, 2022 at 1:39 PM Mariusz Felisiak
 wrote:
>
> Hi y'all,
>
> Django 3.2+ supports "db_collation" [1] for "CharField" and "TextField" 
> along with migration operations ("CreateCollation()", "RemoveCollation") and 
> the database function "Collate()" [3]. Moreover CI fields and the entire 
> "citext" module are discouraged since PostgreSQL 12 [4] 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 (and remove them in Django 5.0).
>
> Best,
> Mariusz
>
> [1] https://code.djangoproject.com/ticket/31777
> [2] https://code.djangoproject.com/ticket/32046
> [3] https://code.djangoproject.com/ticket/21181
> [4] https://www.postgresql.org/docs/12/citext.html
>
> --
> 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-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/833bb13b-3db1-f35b-3d51-a2a4671b45a9%40gmail.com.



-- 
Paolo Melchiorre

https://www.paulox.net

-- 
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-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAKFO%2Bx5j8Y6%2BMH_%2Bug-BGKZ6qaWD9tRWVLXLOXhmTQuvrN8tzw%40mail.gmail.com.


Re: Deprecate CICharField, CIEmailField, CITextField

2022-01-25 Thread Tom Carrick
Hi,

I'm not too sure about this.

While Postgres encourages using non-deterministic collations, they're not
without their downsides. For example, you can't do a LIKE query on a field
using a non-deterministic collation, but you can with CItext - although I
don't believe there's a way to index it. Say, for example, you want to
store your user emails CI - this is great for logging in but it makes it
impossible to search for users with a particular email domain, or trying to
find someone by the username part, say.

On the other hand, we could just say: don't use either, put an index on
UPPER and make sure you always use iexact.

I don't have a very strong opinion.

Cheers,
Tom


On Tue, 25 Jan 2022 at 14:01, Paolo Melchiorre  wrote:

> Hi Mariusz,
>
> I agree with you on deprecating and then removing CI fields.
>
> I only would suggest adding some examples of migrations from CI fields
> to collations in the deprecation notes to help users to easily
> migrate.
>
> So +1 for me too.
>
> Ciao,
> Paolo
>
> On Tue, Jan 25, 2022 at 1:39 PM Mariusz Felisiak
>  wrote:
> >
> > Hi y'all,
> >
> > Django 3.2+ supports "db_collation" [1] for "CharField" and
> "TextField" along with migration operations ("CreateCollation()",
> "RemoveCollation") and the database function "Collate()" [3]. Moreover CI
> fields and the entire "citext" module are discouraged since PostgreSQL 12
> [4] 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 (and remove them in Django 5.0).
> >
> > Best,
> > Mariusz
> >
> > [1] https://code.djangoproject.com/ticket/31777
> > [2] https://code.djangoproject.com/ticket/32046
> > [3] https://code.djangoproject.com/ticket/21181
> > [4] https://www.postgresql.org/docs/12/citext.html
> >
> > --
> > 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-developers+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/833bb13b-3db1-f35b-3d51-a2a4671b45a9%40gmail.com
> .
>
>
>
> --
> Paolo Melchiorre
>
> https://www.paulox.net
>
> --
> 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-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAKFO%2Bx5j8Y6%2BMH_%2Bug-BGKZ6qaWD9tRWVLXLOXhmTQuvrN8tzw%40mail.gmail.com
> .
>

-- 
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-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAHoz%3DMZH_eFng_eehDYkWAf7GnW27XFr7wa9%3D4tqjeDvxJrCsA%40mail.gmail.com.


Re: Deprecate CICharField, CIEmailField, CITextField

2022-01-25 Thread Mariusz Felisiak
wtorek, 25 stycznia 2022 o 13:59:54 UTC+1 Adam Johnson napisał(a):

> My initial concern was around the minimum PostgreSQL version that Django 
> 5.0 will support. According to 
> https://en.wikipedia.org/wiki/PostgreSQL#Release_history , PostgreSQL 10 
> is supported until 2022-11-10 , and version 11 until 2023-11-09. With 
> Django 5.0 expected in 2024-01, it should be fine to deprecate the CI 
> fields for removal in Django 5.0. Users on old PostgreSQL versions can 
> manage the deprecation warning until they upgrade.
>

Yes, support for PostgreSQL 10 will be dropped in Django 4.2, and support 
for PostgreSQL 11 will be dropped in Django 5.0.
  

-- 
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-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/099d6c65-9e03-46e5-b0d5-23035531f480n%40googlegroups.com.