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

Re: Rules and Views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Curt Sampson <cjs(at)cynic(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Rules and Views
Date: 2002-07-31 05:03:06
Message-ID: 24939.1028091786@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Curt Sampson <cjs(at)cynic(dot)net> writes:
> ERROR:  Cannot insert into a view without an appropriate rule

>> 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"?

Well, to my mind that's what the error message says now.  The reason
it didn't help you was that you *did* have a rule ... but it didn't
completely override the view insertion.

I'm not sure how to phrase a more useful message.  Note that the place
where the error can be detected doesn't have any good way to know that
a non-INSTEAD rule was in fact processed, so we can't say anything quite
as obvious as "You needed to use INSTEAD in your rule, luser".  Can we
cover both the no-rule-at-all case and the had-a-rule-but-it-wasn't-
INSTEAD case in a single, reasonably phrased error message?  (Just
to make life interesting, there's also the case where you made an
INSTEAD rule but it's conditional.)

> Also, some examples in the manual would be helpful.

Aren't there several already?  But feel free to contribute more...

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Larry RosenmanDate: 2002-07-31 05:05:07
Subject: Re: Virus Emails
Previous:From: Marc G. FournierDate: 2002-07-31 05:01:43
Subject: Re: Open 7.3 items

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