Lee McFadden wrote:
> On 08/11/05, Ian Bicking <[EMAIL PROTECTED]> wrote:
> 
> 
>>One data design note -- I don't think you should normally give length to
>>StringCol (i.e., you should use TEXT).  Fixed-length fields are a relic
>>of the 80's; modern databases can and do deal pretty well with arbitrary
>>length text fields.  Except MySQL doesn't allow indexes on them.  Dumb
>>MySQL.  In fact, if I remember correctly (and I may not), many databases
>>will be more space-efficient with arbitrary length fields, because they
>>don't preallocate the full length, but they frequently do for fixed
>>length fields.
> 
> 
> As you say, MySQL is the killer there.  If the length column isn't in
> it complains to high heaven.  Although, doesn'y MySQL have a TEXT
> column type?  I wonder if it would be possible to have SQLObject
> automatically create a TEXT column if you don't specify a length in a
> StringCol?

It does.  The only issue I know of is that you can't put an index on
such a column.  Silly, really, as it would be perfectly fine to only
index the first 255 characters and ignore the rest.  But oh well.  Or
maybe you just couldn't put an index on BLOB columns?  Now I can't
remember; it came up in the SQLObject bug tracker recently, mostly
because MySQL gives a weird and confusing error message when it happens.

-- 
Ian Bicking  |  [EMAIL PROTECTED]  |  http://blog.ianbicking.org

Reply via email to