Re: savepoints
От | Alvaro Herrera |
---|---|
Тема | Re: savepoints |
Дата | |
Msg-id | 20060412172947.GF26756@surnet.cl обсуждение исходный текст |
Ответ на | savepoints ("Sriram Dandapani" <sdandapani@counterpane.com>) |
Список | pgsql-admin |
Sriram Dandapani wrote: > This is the scenario: > > > > Controller function fncCtrl calls function A, function B and function C > in that order. > > Function A needs a savepoint to prevent errors from undoing work that > needs to be committed regardless of errors in function B or C > > Is there a way to define a generic savepoint that any errors in B or C > will rollback to. What you can do is to have fncCtrl like this: BEGIN perform A(); BEGIN perform B(); perform C(); EXCEPTION WHEN ... -- here, either B or C failed END END If B or C fail, the changes made by A will persist. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.
В списке pgsql-admin по дате отправления: