I wrote:
>> On Mon, Mar 12, 2018 at 2:26 PM, Steven Roth wrote:
>>> More generally: how can one write trigger functions for a view (that is
>>> not automatically updatable), such that INSERT ... ON CONFLICT DO UPDATE
>>> will work with the correct semantics?
> Don't think it's possible unfortuna
Melvin Davidson writes:
> On Mon, Mar 12, 2018 at 2:26 PM, Steven Roth wrote:
>> Why does the following code raise an error?
>>
>> CREATE TABLE ttest (x integer);
>> CREATE VIEW vtest AS SELECT x FROM ttest;
>> CREATE FUNCTION vtest_insert() RETURNS trigger LANGUAGE plpgsql AS $$
>> RAISE 'foo'
On Tue, Mar 13, 2018 at 10:02 AM, David G. Johnston <
david.g.johns...@gmail.com> wrote:
> On Tue, Mar 13, 2018 at 6:47 AM, Melvin Davidson
> wrote:
>
>> On Mon, Mar 12, 2018 at 2:26 PM, Steven Roth
>> wrote:
>>
>>> This code raises the error 'foo', even though the insert says DO NOTHING
>>> and
On Tue, Mar 13, 2018 at 6:47 AM, Melvin Davidson
wrote:
> On Mon, Mar 12, 2018 at 2:26 PM, Steven Roth
> wrote:
>
>> This code raises the error 'foo', even though the insert says DO NOTHING
>> and the error type is unique_violation. Why?
>>
>> More generally: how can one write trigger function
On Mon, Mar 12, 2018 at 2:26 PM, Steven Roth wrote:
> Why does the following code raise an error?
>
> CREATE TABLE ttest (x integer);
> CREATE VIEW vtest AS SELECT x FROM ttest;
> CREATE FUNCTION vtest_insert() RETURNS trigger LANGUAGE plpgsql AS $$
> RAISE 'foo' USING ERRCODE='unique_violati
Why does the following code raise an error?
CREATE TABLE ttest (x integer);
CREATE VIEW vtest AS SELECT x FROM ttest;
CREATE FUNCTION vtest_insert() RETURNS trigger LANGUAGE plpgsql AS $$
RAISE 'foo' USING ERRCODE='unique_violation';
END $$;
CREATE TRIGGER vtest_insert INSTEAD OF INSERT ON vte