On Thursday, 6 December 2012 13:58:47 UTC, Javier Guerra wrote:

> On Thu, Dec 6, 2012 at 6:18 AM, joy <[email protected] <javascript:>> 
> wrote: 
> >  content = models.CharField(max_length=500) 
>
> is that size even supported? 
>
> models.CharField maps to a VARCHAR() field, which AFAIK, is typically 
> limited to 255 chars.
>

No, it isn't. MySQL has a limit of 65,536 bytes (which is actually shared 
among all columns in a row); PostgreSQL appears to have a 1GB limit per 
field. Certainly there can be good reasons for using a long CharField 
rather than a TextField: again in MySQL's InnoDB, a TEXT field is a blob, 
which means it is stored separately from the rest of the row, making 
retrieval more expensive, and causing JOINs to write temporary indexes to 
disk. Although admittedly the opposite is true in Postgres; it stores a 
VARCHAR as a text field.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/xx9DUE1SyOQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to