DatabaseError:当前事务中止,命令被忽略,直到事务块结束 [英] DatabaseError: current transaction is aborted, commands ignored until end of transaction block
问题描述
我收到了很多错误信息:
DatabaseError:当前事务被中止,直到结束从python-psycopg更改为python-psycopg2作为Django项目的数据库引擎,交易块
p>
代码保持不变,只是不知道那些错误来自哪里。
这是Postgres在查询产生错误时所做的,您尝试运行另一个查询,而无需先回滚事务。要解决这个问题,你需要弄清代码中哪些错误的查询被执行。使用 log_statement 和 log_min_error_statement 选项在您的postgresql服务器。
I got a lot of errors with the message :
"DatabaseError: current transaction is aborted, commands ignored until end of transaction block"
after changed from python-psycopg to python-psycopg2 as Django project's database engine.
The code remains the same, just dont know where those errors are from.
This is what postgres does when a query produces an error and you try to run another query without first rolling back the transaction. To fix it, you'll want to figure out where in the code that bad query is being executed. It might be helpful to use the log_statement and log_min_error_statement options in your postgresql server.
这篇关于DatabaseError:当前事务中止,命令被忽略,直到事务块结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!