Re: how to use SAVEPOINT in stored function

Поиск
Список
Период
Сортировка
От Volkan YAZICI
Тема Re: how to use SAVEPOINT in stored function
Дата
Msg-id 7104a7370512050835l520aa496kcb74c230e05411d4@mail.gmail.com
обсуждение исходный текст
Ответ на Re: how to use SAVEPOINT in stored function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On 12/5/05, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> In plpgsql, you're supposed to use exception blocks instead.

AFAIC, SAVEPOINT usage isn't permitted in any procedural language. But
it also isn't documented. (I couldn't find any phrase mentioning about
this in the docs.)

One more question, if we'd try to use a SAVEPOINT inside an SQL
function, it dumps below error:
  ERROR:  SAVEPOINT is not allowed in a SQL function
  CONTEXT:  SQL function "tmp_func" during startup
But we got below error message if we'd try the same in a pl/pgsql precedure:
  ERROR:  SPI_execute_plan failed executing query "SAVEPOINT svp0":
  SPI_ERROR_TRANSACTION
  CONTEXT:  PL/pgSQL function "tmp_func" line 4 at SQL statement

Is it possible to make the latter error message some more informative
and user-friendly like the one in the previous?


Regards.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: how to use SAVEPOINT in stored function
Следующее
От: "Ed L."
Дата:
Сообщение: troubleshooting hung postmasters