| От | Richard Huxton |
|---|---|
| Тема | Re: Transactions, Triggers and Error Messages |
| Дата | |
| Msg-id | 4371A5B5.9020909@archonet.com обсуждение исходный текст |
| Ответ на | Re: Transactions, Triggers and Error Messages (Ledina Hido <lh1101@ecs.soton.ac.uk>) |
| Список | pgsql-general |
Ledina Hido wrote: > > Thinking about it, the EXCEPTION statement would be inside my user- > defined function (where I raise the exception in the first place), so I > cannot see how that would help. As far as I could understand, I cannot > call "ROLLBACK" (which is what I want to do) inside a user defined > function. I tried calling it and it was simply ignored. Or am I missing > something here? Yes - you want to read up on SAVEPOINTs to handle exceptions at the applicaton level. You do something like: SAVEPOINT foo; ...command that works... ...command that works... ...oops, this one gives me an error... ROLLBACK TO SAVEPOINT foo; Exceptions in plpgsql are just a wrapper to this process. -- Richard Huxton Archonet Ltd
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера