Re: feature proposal - triggers by semantics

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: feature proposal - triggers by semantics
Дата
Msg-id 50A4C302.1000909@2ndQuadrant.com
обсуждение исходный текст
Ответ на Re: feature proposal - triggers by semantics  (Craig Ringer <craig@2ndQuadrant.com>)
Ответы Re: feature proposal - triggers by semantics  (Craig Ringer <craig@2ndQuadrant.com>)
Re: feature proposal - triggers by semantics  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On 11/15/2012 09:48 AM, Craig Ringer wrote:
> If you want to prevent TRUNCATE, deny the privilege or add a trigger
> that aborts the command.
You can abort the transaction but not skip action as currently it is only
possible to skip in ROW level triggers.

So I'd modify this request to allow BEFORE EACH STATEMENT triggers
to also be able to silently skip current action like BEFORE EACH ROW 
triggers can.

Then this request would simply be satisfied by a simple trigger which
rewrites TRUNCATE into DELETE .

Hannu

>
> TRUNCATE should do what it says, not magically be changed to do
> something else by a GUC.
>> Or alternately/also provide extra syntax to TRUNCATE itself where one
>> can specify which behavior to have, and both options can be given
>> explicitly to override any config option.
> What advantage would that have over using DELETE when you want DELETE,
> and TRUNCATE when you want TRUNCATE?
>




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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: feature proposal - triggers by semantics
Следующее
От: Greg Smith
Дата:
Сообщение: Re: Materialized views WIP patch