[Tutor] string pickling and sqlite blob'ing

Richard Lovely roadierich at googlemail.com
Thu Jun 25 02:07:08 CEST 2009


2009/6/24 Dinesh B Vadhia <dineshbvadhia at hotmail.com>:
> Hi Vince
>
> That's terrific!  Once a string is compressed with gzip.zlib does it make a
> difference whether it is stored it in a TEXT or BLOB column?
>
> Dinesh
>
>
>From the MySQL language reference:
"""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.

The four TEXT types TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT
correspond to the four BLOB types and have the same maximum lengths
and storage requirements. The only difference between BLOB and TEXT
types is that sorting and comparison is performed in case-sensitive
fashion for BLOB values and case-insensitive fashion for TEXT values.
In other words, a TEXT is a case-insensitive BLOB."""

gzip.zlib outputs binary data, so you should use BLOB.
Pickle, I believe, outputs an ascii string, so should use TEXT.

Hope that makes it a bit clearer.
-- 
Richard "Roadie Rich" Lovely, part of the JNP|UK Famile
www.theJNP.com


More information about the Tutor mailing list