Re: Re: (expert) "insert into VIEW returning" inside an instead of trigger returns nothing

Поиск
Список
Период
Сортировка
От Willy-Bas Loos
Тема Re: Re: (expert) "insert into VIEW returning" inside an instead of trigger returns nothing
Дата
Msg-id CAHnozTg6M5OoNcS9i9ciXWY2_zE=7SV7G=kY+_cJnJTM8BfZhQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: (expert) "insert into VIEW returning" inside an instead of trigger returns nothing  (Rémi Cura <remi.cura@gmail.com>)
Список pgsql-general
On Wed, Sep 2, 2015 at 2:16 PM, Rémi Cura <remi.cura@gmail.com> wrote:
I think I got it,
I have to always return something (like NEW) in the instead of trigger,
but fill NEW
with returnings of INSERT into regular table.


Yes, the GID is detemined for the table.
But in test.rc_editing_generic_object(  ) you are reurning the NEW that you just inserted from test.rc_editing_specific_object(  ).
The gid is filled for the table, but since you are doing an INSERT on the table INSTEAD of the one that came in, the gid is not filled. The view does not read from the table in this case, but writes, so the gid is not yet available in NEW.

Cheers,

Willy-Bas

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: FDW and BDR
Следующее
От: Willy-Bas Loos
Дата:
Сообщение: Re: FDW and BDR