I find that using TextField rather than CharField just to make postgres use 
varchar() is a terrible idea, if you are implementing an reusable app and 
it is used on a backend like MySQL where TextFields are created as text 
columns which are horribly inneficient and should be avoided at any cost 
you will have a really bad time.
I'm not sure about postgres but I want to believe that using varchar 
without limits has also some performance considerations that should be 
taken care of.

El lunes, 29 de febrero de 2016, 17:58:33 (UTC-3), Shai Berger escribió:
>
> Hi, 
>
> Thank you, Aymeric, for summing up the discussion this way. The division 
> into 
> two separate problems is indeed required, and I fully support the idea of 
> setting max_length's default to 100 or 120. 
>
> There seem to be just two points worth adding to your summary: 
>
> On Monday 29 February 2016 11:19:02 Aymeric Augustin wrote: 
> > 
> > 2) How can we make it easy for PostgreSQL users to just use VARCHAR()? 
> > 
> > Since this is a PostgreSQL-specific feature, having a variant of 
> CharField 
> > in django.contrib.postgres that supports and perhaps even defaults to 
> > unlimited length shouldn’t be controversial. 
> > 
>
> The first -- I believe it was raised very early on by Christophe Pettus -- 
> is 
> that Django already has a field that manifests on PG as VARCHAR(), and 
> that is 
> TextField. However, I don't like the idea that PG users should be using 
> TextField(widget=TextInput) as a replacement for CharField; I find that 
> counter-intuitive -- even if just because it is a "bad name". Names are 
> important. 
>
> The second -- in response to a comment made by Josh Smeaton -- is that 
> having 
> django.db.models.CharField with default max_lenth=N (for some finite N) 
> and 
> django.contrib.postgres.CharField with default max_length=None (meaning 
> infinity) sounds like a bad idea. 
>
> > 
> > I hope this helps! 
>
> I'm certain it did! 
>
> Shai. 
>

-- 
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/37cd6e9c-ec5e-4a69-99a5-84ca11853afe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to