Re: problem with TRUNCATE TABLE in plpgsql function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: problem with TRUNCATE TABLE in plpgsql function
Дата
Msg-id 26345.1036166628@sss.pgh.pa.us
обсуждение исходный текст
Ответ на problem with TRUNCATE TABLE in plpgsql function  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
Список pgsql-bugs
Pavel Stehule <stehule@kix.fsv.cvut.cz> writes:
> I played with some own old plpgsql functions. I found "error" in plpgsql
> 7.3. When I use TRUNCATE TABLE in function I get
> TRUNCATE TABLE cannot be executed from a function.
> In 7.2.2. I can use this command. Why, now I can't use truncate table?

This is a deliberate change for safety reasons: if your function errors
out after performing TRUNCATE, you are in big trouble.

If TRUNCATE is ever rewritten to be rollback-safe, we will remove the
restriction.

            regards, tom lane

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: problem with TRUNCATE TABLE in plpgsql function
Следующее
От: "saurabh garg"
Дата:
Сообщение: Re: hi-problem while installing postgressql 7.2 version