Catching exceptions and rolling back transactions
2
votes
1
answer
1525
views
I am just trying to see if I understand this correctly:
> By default, any error occurring in a PL/pgSQL function aborts
> execution of the function and the surrounding transaction
I have a procedure which does multiple insert operations on different tables, however at the moment I did not make them into a singular transaction. Does the above documentation mean that if an error were to occur all operations performed inside the procedure would be rolled back or do I need to catch exceptions and perform rollback/commit manually?
Asked by Lugoom485
(45 rep)
Feb 29, 2024, 11:35 AM
Last activity: Feb 29, 2024, 01:46 PM
Last activity: Feb 29, 2024, 01:46 PM