On Sat, 16 Apr 2005, Robert Dunlop wrote:
>Your question was would a TINYBLOB hold 1,000 characters.
>TINYBLOB (TINYTEXT) = 257 characters. 1,000 > 257 = No.
>Your next option, BLOB (TEXT) = 64K. 1,000 < 64K = Yes.
Yeah, I got that part, more generally my question is what are the maximum
sizes (in characters) of each of the BLOB / TEXT types, and why isn't that
information on the manual page for BLOB / TEXT types.
Another question comes to mind, which is why is TINYTEXT so useless?
A VARHCAR(255) is nearly as good! I would have thought any datatype with
BLOB in its name would have the self respect to hold at least 65536
Thanks for the pointers so far,
>----- Original Message -----
>From: "Dan Bolser" <dmb@stripped>
>To: "Hassan Schroeder" <hassan@stripped>
>Sent: Saturday, April 16, 2005 1:49 PM
>Subject: Re: Size of BLOB types?
>On Sat, 16 Apr 2005, Hassan Schroeder wrote:
>>Dan Bolser wrote:
>>> The manual dosn't specify the maximum number of characters in the
>>> TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT data types.
>>> Are these valid synonyms, TINYBLOB, MEDIUMBLOB and LONGBLOB?
>>The very beginning of the cited page is:
>> A BLOB is a binary large object that can hold a variable amount of
>> data. The four BLOB types, TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB,
>> differ only in the maximum length of the values they can hold.
>> See Section 11.5, >>
>> The four TEXT types, TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT,
>> correspond to the four BLOB types and have the same maximum lengths
>> and storage requirements.
>>And if you follow that link to Section 11.5, you'll find the size
>>of all of the above, and the answer to your question:
>>> I have a field with just under 1000 characters, am I OK with a TINYTEXT?
>>:: which is "nope" :-)
>Naturally I followed that link, but was unable to understand (or piece
>together) the information there in.
>Storage Requirements for String Types:
>(or maximum length of BLOB types for dummies)
>TINYBLOB (or TINYTEXT) = 1+(2^ 8) = 257 characters
>BLOB (or TEXT) = 2+(2^16) = 65538 characters
>MEDIUMBLOB (or MEDIUMTEXT) = 3+(2^24) = 16777219 characters
>LONGBLOB (or LONGTEXT) = 4+(2^32) = 4294967300 characters
>Does that answer my question?
>I think it does, but I am not sure. Seems strange not to have this
>information at the very begining of the cited page.