On Wed, 22 Jan 2020 at 16:45, Ants Aasma <a...@cybertec.at> wrote: > The intended use case of two phase transactions is ensuring atomic > durability of transactions across multiple database systems.
Exactly. I was trying to find a good way to say this. It doesn't make much sense to embed a 2PC resolver in Pg unless it's an XA coordinator or similar. And generally it doesn't make sense for the distributed transaction coordinator to reside alongside one of the datasources being managed anyway, especially where failover and HA are in the picture. I *can* see it being useful, albeit rather heavyweight, to implement an XA coordinator on top of PostgreSQL. Mostly for HA and replication reasons. But generally you'd use postgres instances for the HA coordinator and the DB(s) in which 2PC txns are being managed. While you could run them in the same instance it'd probably mostly be for toy-scale PoC/demo/testing use. So I don't really see the point of doing anything with 2PC xacts within Pg proper. It's the job of the app that prepares the 2PC xacts, and if that app is unable to resolve them for some reason there's no generally-correct action to take without administrator action.