使用python将postgresql bytea文件还原为excel

使用python将postgresql bytea文件还原为excel,python,postgresql,blob,Python,Postgresql,Blob,我将excel文件作为Blob存储在postgresql表中,使用: insert into table values (id, pg_read_binary_file(/path/file.xlsx)) 我想再次将其还原为excel文件,以使用plpython3u操作excel数据并将其保存到表中 当我将记录(bytea)保存到文件并在python中运行时: with open(r'path\file') as f: print(f) 结果是: 如何使用blob重新创建excel并

我将excel文件作为Blob存储在postgresql表中,使用:

insert into table values (id, pg_read_binary_file(/path/file.xlsx))
我想再次将其还原为excel文件,以使用plpython3u操作excel数据并将其保存到表中

当我将记录(bytea)保存到文件并在python中运行时:

with open(r'path\file') as f:
    print(f)
结果是:
如何使用blob重新创建excel并使用它生成dataframe

也许用这种方法存储数据是错误的

干杯