Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 2, 2015 at 2:16 PM, Rémi Cura <remi.cura@xxxxxxxxx> 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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux