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
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',
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
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
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