我是PostgreSQL / libpq的新手。因此,请帮助我澄清我的困惑:
假设我从执行“ START TRANSACTION”开始并进行了正确的错误检查(PQresultStatus(res)!= [proper_success_value]),如果插入后出现问题,是否需要执行“ ROLLBACK”?例如:
在这种情况下,我是否需要在“ UPDATE”失败后执行“ ROLLBACK”?另外,如果“ ROLLBACK”也失败怎么办?
database postgresql transactions libpq
database ×1
libpq ×1
postgresql ×1
transactions ×1