navicat中执行PostgreSQL错误解决:ERROR: current transaction is aborted, commands ignored until end of transaction block


错误出现:

含有错误的查询后,选中insert语句无法执行,报错current transaction is aborted, commands ignored until end of transaction block

分析:

事务中含有错误,再执行DML时,事务无法正常进行。

解决方法:

1.尝试connection.setAutoCommit(true);无法执行

2.直接commit ,提交后再执行insert语句,成功插入。

 

参考了stackoverflow的解法:

https://stackoverflow.com/questions/10399727/psqlexception-current-transaction-is-aborted-commands-ignored-until-end-of-tra


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM