Skip site navigation (1) Skip section navigation (2)

Re: Rules and Views

From: Curt Sampson <cjs(at)cynic(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Rules and Views
Date: 2002-07-31 04:40:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Tue, 30 Jul 2002, Tom Lane wrote:

> Curt Sampson <cjs(at)cynic(dot)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.

Curt Sampson  <cjs(at)cynic(dot)net>   +81 90 7737 2974
    Don't you know, in this new Dark Age, we're all light.  --XTC

In response to


pgsql-hackers by date

Next:From: Curt SampsonDate: 2002-07-31 04:42:25
Subject: Re: WAL file location
Previous:From: Curt SampsonDate: 2002-07-31 04:36:44
Subject: Re: WAL file location

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group