Re: Rules and Views - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Rules and Views
Date
Msg-id 24290.1028086360@sss.pgh.pa.us
Whole thread Raw
In response to Rules and Views  (Curt Sampson <cjs@cynic.net>)
Responses Re: Rules and Views  (Curt Sampson <cjs@cynic.net>)
List pgsql-hackers
Curt Sampson <cjs@cynic.net> writes:
> CREATE VIEW test AS ...
> CREATE RULE test_insert AS
>     ON INSERT TO test
>     DO  ...
> INSERT INTO test VALUES (1, 'one', 'onemore');
> ERROR:  Cannot insert into a view without an appropriate rule

> What am I doing wrong here? Is there a bug?

Make that "ON INSERT DO INSTEAD".  As coded, the rule leaves the
original insertion into the view still active.

Perhaps the error message could be phrased better --- any thoughts?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: getpid() function
Next
From: Bruce Momjian
Date:
Subject: Open 7.3 items