Re: rollback in C functions

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: rollback in C functions
Дата
Msg-id 20150219213400.GL2500@alvh.no-ip.org
обсуждение исходный текст
Ответ на rollback in C functions  (Juan Pablo L <jpablolorenzetti@gmail.com>)
Ответы Re: rollback in C functions  (Juan Pablo L <jpablolorenzetti@gmail.com>)
Список pgsql-general
Juan Pablo L wrote:
> Hello, i have created a function (in C) that receives an array that
> contains tuples of ID's and values.

Why are you writing a C function?  Sounds like you could accomplish the
same with a plpgsql function, with much less effort.

> The function is to execute updates on each ID assigning the value, but if
> one of these operation fails (does not meet certain criteria)
> inside the function i would like to rollback and leave everything
> untouched, in case other ID;s were already updated previously,
> and come back to the caller and inform about it.

Do you want previous updates to remain in place, or do you want to roll
them back too?  This is not clear.


--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: zach cruise
Дата:
Сообщение: Re: select where true, or select where input = '$var'
Следующее
От: Juan Pablo L
Дата:
Сообщение: Re: rollback in C functions