I'm trying to insert a file compressed with lzma into a postgresql table with a bytea field. The problem is that it's unable to format the string and this error occurs:
TypeError: not all arguments converted during string formatting
To insert the data in the database, i'm using psycopg2:
CUR.execute(f"""INSERT INTO table (id, date, bytes) """ + """VALUES ("{file_name}", CURRENT_DATE, %s""", (str(compress(file.read()))[2:-1]))
Any ideas?