Binary objects using psycopg postgresql adapter
21 Jan
2003
21 Jan
'03
8:25 p.m.
Hi, I want to store binary objects (JPEG, PDF) into a PostgreSQL database. I used to do this in plain Python via from psycopg import * ... binobj = Binary(file) query = "INSERT INTO Table (Id, binaryobject) VALUES (%d, %s)" curs.execute(query, (i, binobj)) If I want to do this in a python script I can not import psycopg explicitely. But if I use a Z Psycopg Database Connection 'ZPsyCon' I can issue database queries using context.ZPsyCon.manage_test(query, REQUEST=None) Is there any way to store binary objects via this method. The only alternative I could see are External Methods. Any hints how to do this right? Kind regards Andreas.
8476
Age (days ago)
8476
Last active (days ago)
0 comments
1 participants
participants (1)
-
Andreas Tille