Re: Rules and Views - Mailing list pgsql-hackers

From Curt Sampson
Subject Re: Rules and Views
Date
Msg-id Pine.NEB.4.44.0207311337000.493-100000@angelic.cynic.net
Whole thread Raw
In response to Re: Rules and Views  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Rules and Views  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, 30 Jul 2002, Tom Lane wrote:

> 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.

Ah, I see! My model of how this was working was wrong.

> Perhaps the error message could be phrased better --- any thoughts?

Maybe a message that says something along the lines of "cannot insert
into views; you need to override this behaviour with a rule"? Also, some
examples in the manual would be helpful.

cjs
-- 
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.netbsd.org   Don't you know, in this new Dark Age, we're
alllight.  --XTC
 



pgsql-hackers by date:

Previous
From: Curt Sampson
Date:
Subject: Re: WAL file location
Next
From: Curt Sampson
Date:
Subject: Re: WAL file location