Re: transaction in function

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: transaction in function
Дата
Msg-id 20061205162319.GB11315@a-kretschmer.de
обсуждение исходный текст
Ответ на transaction in function  (Marian POPESCU <softexpert@libertysurf.fr>)
Список pgsql-sql
am  Tue, dem 05.12.2006, um 16:25:31 +0100 mailte Marian POPESCU folgendes:
> Hi,
> 
> I want to write a function that updates several tables; if there is an
> exception while updating, it should rollback the transaction and raise an
> error.
> 
> How can this be done in pgPLSQL in PostgreSQL 8.1 ?

A function runs within a transaction. You can trapp errors within a
function, read this:

http://www.postgresql.org/docs/8.1/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47215,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net


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

Предыдущее
От: Marian POPESCU
Дата:
Сообщение: transaction in function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: transaction in function