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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Larry Rosenman 2002-07-31 05:05:07 Re: Virus Emails
Previous Message Marc G. Fournier 2002-07-31 05:01:43 Re: Open 7.3 items