It’s a key “primitive” missing from almost all high-level programming languages, with the notable exception of some SQL dialects.
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.
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).
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.