Re: BUG #14350: VIEW with INSTEAD OF INSERT TRIGGER and COPY. Missing feature or working as designed. - Mailing list pgsql-bugs

From Dilip Kumar
Subject Re: BUG #14350: VIEW with INSTEAD OF INSERT TRIGGER and COPY. Missing feature or working as designed.
Date
Msg-id CAFiTN-tdd_DxpdpuHocWPCgxWnGeTBA9-i67hFNE4wmRHEnfrA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #14350: VIEW with INSTEAD OF INSERT TRIGGER and COPY. Missing feature or working as designed.  (Haribabu Kommi <kommi.haribabu@gmail.com>)
List pgsql-bugs
On Tue, Oct 4, 2016 at 1:07 PM, Haribabu Kommi <kommi.haribabu@gmail.com> wrote:
> I think currently there is no handling of INSTEAD of triggers in the copy
> functionality.
>
> It didn't seem difficult to the support the same, until unless there are any
> problems for complext queries, so after adding the INSTEAD of triggers
> check and calling the ExecIRInsertTriggers function, the Copy is also
> working for the view.
>
> Attached is a POC patch of the same. I didn't checked all the possible
> scenarios.

We support insert into view in below 2 cases..

1. INSTEAD OF INSERT trigger
2. or an unconditional ON INSERT DO INSTEAD rule

In your patch we are supporting first one in COPY command, Will it not
be good to support second one also in COPY command ?

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

pgsql-bugs by date:

Previous
From: Grygoriy Gonchar
Date:
Subject: Re: BUG #14397: Updatable VIEW doesn't work with ON CONFLICT from PgPreparedStatement
Next
From: bashtanov@imap.cc
Date:
Subject: BUG #14407: pg_attribute shows old column names for indexes