【发布时间】:2019-09-15 04:40:33
【问题描述】:
我正在使用 pyscopg2 来管理一些 postgresql 数据库连接。
我发现here 和docs 似乎 psycopg2 默认模拟非自动提交模式。还有postgresqltreats every statement as a transaction,基本上是autocommit模式。
我的疑问是,如果 psycopg 和 postgresql 都处于默认模式,会发生哪种情况?或者如果这两者都不是,究竟会发生什么。任何性能建议也将不胜感激。
Code Psycopg2 Postgresql
Some statements --> One big transaction --> Multiple simple transactions
or
Some statements --> One big transaction --> Big transaction
【问题讨论】:
标签: python postgresql psycopg2