storing pickles in sql data base
gagsl-py2 at yahoo.com.ar
Wed Jul 11 04:47:36 CEST 2007
En Tue, 10 Jul 2007 20:32:01 -0300, David Bear <david.bear at asu.edu>
> I need to store pickled objects in postgresql. I reading through the
> docs it says to always open a file in binary mode because you can't be
> if the pickled data is binary or text. So I have 2 question. Can I set
> pickle to be text -- and then store it in a 'text' type field in my sql
> table, or should what sql type should I save the pickle as?
I'd use a binary datatype (raw, blob, binary, whatever postgres calls it).
Text columns might be converted or reencoded in some way, binary data
should never be modified in any way.
More information about the Python-list