On 23 mai, 23:14, nayden <[EMAIL PROTECTED]> wrote: > and then I try to restore the object with the following code > > def success(rv): > print "success" > str = cStringIO.StringIO(libpq.PgUnQuoteBytea(rv[0][0])) > i = cPickle.load(str) > i.toString() > > the execution fails just after the print statement, and I am not quite > sure why is that.
Please reread the doc for pickle.dump, pickle.dumps, pickle.load and pickle.loads. You just don't need StringIO here, just use the 's versions of the functions. > I would love to find out what people are using when they need to do > something similar > perhaps I am trying to do it the perl way, while there is an elegant > python solution. I don't know if you'd label it 'elegant', but as far as I'm concerned, storing serialized objects as blobs in a relational database is mostly non-sense. If I use a relational database, it's because it is a *relational* database. If you want an OODB, then we have the ZODB, Durus and a couple others. -- http://mail.python.org/mailman/listinfo/python-list