python - TypeError: 'psycopg2._psycopg.Binary' object does not support indexing -
i need help, i'm trying insert files (.txt) postgres using psycopg2 python, sends error , don't understand...
error:
typeerror: 'psycopg2._psycopg.binary' object not support indexing
i have:
archivo=open("coordenada.out",'rb').read() cur.execute("insert fhi(coordenadas) values(%s)",(psycopg2.binary(archivo)))
you missing comma:
(psycopg2.binary(archivo),)
it expects iterable. comma make tuple. otherwise try iterate on binary
Comments
Post a Comment