You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
It should be great to be able to start a transaction inside a transaction #985
Some times you want to be able to create functions that has a transaction in it. And sometimes this function is wrapped in a larger function which also makes a transaction. There are no errors on write time, but when running it then Runtime errors occurs. How can we solve this problem?
Activity
BeGj commentedon Jan 6, 2025
@porsager Do you have any thoughts on this?
BeGj commentedon Jun 26, 2025
Bump @porsager
Some times you want to be able to create functions that has a transaction in it. And sometimes this function is wrapped in a larger function which also makes a transaction. There are no errors on write time, but when running it then Runtime errors occurs. How can we solve this problem?
vitaly-t commentedon Sep 24, 2025
I did this within pg-promise, where sub-transactions are automatically handled as savepoints.
@BeGj
porsager commentedon Oct 29, 2026
In v4,
sql.begininside a transaction runs in a savepoint, so code that opens a transaction works the same when given the pool or a transaction.