3 ms·
What's a real nested transaction? What's postgresql missing? https://www.postgresql.org/docs/current/subxacts.html https://www.postgresql.org/docs/current/subx
by werdnapk 2y ago
What's a real nested transaction? What's postgresql missing? https://www.postgresql.org/docs/current/subxacts.html https://www.postgresql.org/docs/current/subxacts.html
- pmarreck 2y agoSavepoints are not considered legitimately isolated nested transactions. To the best of my knowledge. Note: Am not a DBA, merely a full stack dev that has worked with various databases over the years.
- pmarreck 2y agoHad a fascinating conversation with Claude about this (don't worry about the unhinged personality I gave it with preprompting): https://gist.github.com/pmarreck/970e5d040f9f91fd9bce8a4bceee6972 https://gist.github.com/pmarreck/970e5d040f9f91fd9bce8a4bcee... Pasted it there for brevity here. Also includes an easy way to export a Claude conversation (made with the help of Claude, of course).
- jiggawatts 2y agoWhat on Earth are you using as your system prompt!!?
- pmarreck 2y agoLOL, it's amazing
- ants_a 2y agoLLMs are not a great source for this type of information. This mess in no way articulated in what way savepoints and transactions are different. Savepoints are fully equivalent to nested transactions with the constraint that only one is concurrently active. This limitation is just from the SQL standard programming model. At least in PostgreSQL implementation it would be reasonably simple to support multiple concurrent subtransactions. They are even called subtransactions internally.
- jiggawatts 2y agoTransactions are the only composable concurrency control primitive, but this requires that they be nestable. It’s a key “primitive” missing from almost all high-level programming languages, with the notable exception of some SQL dialects.