How can i store pickle dumps data ?

Abandoned besturk at gmail.com
Sat Oct 20 17:24:07 CEST 2007


On Oct 20, 5:32 pm, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> Abandoned schrieb:
>
>
>
>
>
> > Hi..
> > I have some dictionary as {2:3, 4:6, 5:7.........}
> > I want to pickle to these dictionary and save to database but i
> > couldn't..
>
> > My code for adding..
> > a=eval(dict)
> > a=pickle.dumps(a, -1)
> > cursor2.execute("INSERT INTO cache VALUES ('%s', %s)", (x[0],a))
> > conn2.commit()
>
> > i try in UTF-8 postresql database (data type BYTEA) and it gives me
> > this error:
> >> psycopg2.ProgrammingError: invalid byte sequence for encoding "UTF8":
> >> 0x80
> >> HINT:  This error can also happen if the byte sequence does not match
> >> the encoding expected by the server, which is controlled by
> >> "client_encoding".
>
> > i try in LATIN5 postgresql database (data type BYTEA) and it add first
>
> http://mail.python.org/pipermail/python-list/2004-September/280867.html
>
> Diez- Hide quoted text -
>
> - Show quoted text -

Yes this is wonderfull.
I am very happy thank you very much Diez.




More information about the Python-list mailing list