【发布时间】:2021-02-25 12:27:06
【问题描述】:
您好,我正在尝试从 CSV 导入行,但我无法处理类型错误。 例如,如果您在日期时间字段中插入字符串,我会在创建时收到此错误:
psycopg2.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block
尽管处理错误
try:
my_module.create()
exception Except:
#stuff
pass
如何在创建或至少处理错误并采取其他措施之前检查这些值。目前,如果我插入一个选择中不存在的字段,我可以使用 try catch 进行管理,但我不能用于数据类型
【问题讨论】:
标签: python postgresql odoo