我在一个项目中使用 pg_connect 和 pg_query。但我真的不确定 pg_connect 是否使用 AutoCommit 模式?
这是一个重要的问题,因为我需要在事务下写一些块,如果其中一个语句被服务器忽略,数据库就会不一致......
还有一个有趣的问题是执行后执行 pg_query 提交吗?
例如:
pg_query('begin; update table1...; update table2...; commit');
和
pg_query('begin;');
pg_query('update table1...;');
pg_query('update table2...;');
pg_query('commit');
并且是
pg_query('begin; update table1...; update table2...; commit');
在 AutoCommit 模式下工作,所以开始和提交仍然是?
感谢您的帮助:dd