Re: Does 'instead of delete' trigger support modification of OLD

Поиск
Список
Период
Сортировка
От Eugen Konkov
Тема Re: Does 'instead of delete' trigger support modification of OLD
Дата
Msg-id 471116573.20191204133757@yandex.ru
обсуждение исходный текст
Ответ на Re: Does 'instead of delete' trigger support modification of OLD  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Does 'instead of delete' trigger support modification of OLD  (Eugen Konkov <kes-kes@yandex.ru>)
Re: Does 'instead of delete' trigger support modification of OLD  (Eugen Konkov <kes-kes@yandex.ru>)
Список pgsql-hackers
Hi again.

> Thinking some more on this, I now don't think a TODO makes sense, so I
> have removed it.

Please look into this example: https://dbfiddle.uk/?rdbms=postgres_12&fiddle=95ed9fab6870d7c4b6266ea4d93def13
This is real life code from our production.

You  can  see that this is important to get correct info about deleted
data

    -- EXPECTED app_period: ["2018-08-20", "2018-08-25")
    -- ACTUAL   app_period: ["2018-08-14", )

> Triggers are designed to check and modify input data, and since DELETE
> has no input data, it makes no sense.

Please   put   back   into   TODO  list this feature  request to allow
triggers to modify output data.

INPUT     -- receives data                         OK (behavior is expected)
UPDATE  -- receives and returns data     OK (behavior is expected)
DELETE  -- returns data                           FAIL (behavior is not expected)

This  is  inconsistent  to  allow  modify  output  data for UPDATE and
restrict to do this for DELETE


Thank you

-- 
Best regards,
Eugen Konkov




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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: could not stat promote trigger file leads to shutdown
Следующее
От: Eugen Konkov
Дата:
Сообщение: Re: Does 'instead of delete' trigger support modification of OLD