Re: Savepoint/Rollback in functions

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Savepoint/Rollback in functions
Дата
Msg-id 20060314231118.GB8263@surnet.cl
обсуждение исходный текст
Ответ на Savepoint/Rollback in functions  (Scott Petersen <scottpetersen@softhome.net>)
Список pgsql-sql
Scott Petersen wrote:

Hi,

> Question 1:  does pg/psql functions allow "SAVEPOINT/ROLLBACK" 
> functionality? (if so how?)

Yes.  However, you cannot use that syntax directly.  You rather use it
by establishing EXCEPTION clauses in BEGIN/END blocks.  Upon entering
any BEGIN/END block which has an EXCEPTION clause, an implicit SAVEPOINT
is executed.  If any exception (read: error) is found while executing
the block, the savepoint will be automatically rolled back and control
passed to the EXCEPTION block.

HTH,

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


В списке pgsql-sql по дате отправления:

Предыдущее
От: Scott Petersen
Дата:
Сообщение: Savepoint/Rollback in functions
Следующее
От: John DeSoi
Дата:
Сообщение: Re: Copying a row within table