I'm having problems reading bytea fields with psycopg2.
Reading a bytea field with cursor.fetchall yields a memoryview object, not a bytes or bytearray object, and even when the object is explicitly converted to bytes or bytearray, the result is not correct.