可以在建立连接的时候,设置: "host=hostname user=postgres ... options='-c synchronous_commit=off' 3.用户级别 ALTERUSERtrans_userSETsynchronous_commit=ON;ALTERUSERreport_userSETsynchronous_commit=OFF; 4.数据库级别 ALTERDATABASE reportingSETsynchronous_commit=OFF; 5.实例级别 ALTERSYSTEMSETsynchronous_commit=OFF;SHOWsynchronous_commit;
PG的synchronous_commit PostgreSQL复制中有个很重要的参数:synchronous_commit。它决定何时向客户端确认事务提交成功。这个参数不仅仅关于主备同步,还有更广泛的含义,对于单机PG实例也很有用。为了更好地理解,需要了解WAL记录的整个传播过程以及可以接受提交确认的各个阶段。这使得我们能够为每个事务选择不同级别的持久性。
Unlike other commit scope kinds, such asGROUP COMMITandCAMO, the transactions in aSYNCHRONOUS COMMIToperation aren't transformed into a two-phase commit (2PC) transaction. They work more like a Postgressynchronous_commit. Example In this example, when this commit scope is in use, any node in ...
http://postgres.cn/docs/9.6/runtime-config-wal.html france 出的一本书,忘记书名了
By Kaarel Moppel - If you're not yet familiar with the Postgres "synchronous_commit" parameter, you should definitely keep reading. It's one of the important parameters and contains an above-average number of options, which could be a bit daunting for the casual DBA. And in the soon to...