Re: My function run successfully with cursor, but can't change table

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: My function run successfully with cursor, but can't change table
Дата
Msg-id 20130610164837.GG15368@eldon.alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: My function run successfully with cursor, but can't change table  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-general
Thomas Kellerer wrote:
> Kevin Grittner wrote on 10.06.2013 15:19:
> >It has nothing to do with the way you are using the cursor; your
> >problem is that you are causing an error by attempting to COMMIT
> >inside a function (which is not allowed).  This rolls back the
> >subtransaction defined by the BEGIN/EXCEPTION block.  You then
> >suppress any display of the error with the WHEN OTHERS block.
>
> I thought you could *never* use commit (or rollback) inside a function?

You cannot use transaction commands directly, but EXCEPTION blocks
use savepoints internally.

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


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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: My function run successfully with cursor, but can't change table
Следующее
От: Scott Ribe
Дата:
Сообщение: why does this not give a syntax error?