Re: Transaction commit in a trigger function

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Transaction commit in a trigger function
Дата
Msg-id 20070517190342.GO28701@alvh.no-ip.org
обсуждение исходный текст
Ответ на Transaction commit in a trigger function  ("Henka" <henka@cityweb.co.za>)
Список pgsql-general
Henka wrote:

> Is it possible to (somehow) commit a specific statement in a trigger
> function if the function itself is rolled back because of an error (eg, for a
> unique index error)?

No.  You can use savepoints (or, in PL/pgSQL functions, EXCEPTION
blocks) to inhibit the uniqueness error from aborting the transaction.
There is an example in the error catching section of the PL/pgSQL docs
about the insert-if-fail-update construct.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: "Henka"
Дата:
Сообщение: Transaction commit in a trigger function
Следующее
От: Hannes Dorbath
Дата:
Сообщение: Re: Fault Tolerant Postgresql (two machines, two postmasters, one disk array)