How does txid_current() work?
问题 I have the below psql statements: Assumption :initial txid: a select txid_current(); ---------------------- a+1 begin; insert into tab( v1,v2); insert into tab (v3,v4); commit; select txid_current(); ---------------------- a+3 Why do I see the transaction ID as a+3 shouldn't it be a+2 ?? how does txid_current work? Is there any effective way where i could only return the current txid without the additional increment ? 回答1: Key points to understand: Everything is in a transaction. If you don't