Now, I want to extract the data from the current PostgreSQL database, but I need a API. I decided to go with PSYCOPG2, but it seem to have a problem with the BYTEA datatype. I use these lines of code :
Expand|Select|Wrap|Line Numbers
- self.cursor.execute('SELECT * FROM electronicassembly WHERE id_pk = 2')
- list = self.cursor.fetchall()
- print psycopg2.Binary(str(list[0][19]))
Or, do you know another Python API that can handle BYTEA correctly ? Because, for MSSQL the binary for a BULK INSERT as to be in hexadecimal format.
Thanks
P-S : Sorry for my english, it is not my first language