Re: Rule not invoked in 7.1

From: Jan Wieck <janwieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kyle <kyle(at)actarg(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Rule not invoked in 7.1
Date: 2001-01-25 13:21:09
Message-ID: 200101251321.IAA02253@jupiter.greatbridge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tom Lane wrote:
> Kyle <kyle(at)actarg(dot)com> writes:
> > ERROR: Cannot update a view without an appropriate rule.
>
> 7.1 insists that you provide an *unconditional* DO INSTEAD rule
> for a view. What do you think was happening on your old database
> when the "where old.status = 'appr'" clause wasn't satisfied?
> Nothing good I'm afraid.

No harm in the UPDATE case, because so far there aren't any
tuples in the view that could be affected by the still
executed original query. But in an INSERT case, it would let
tuples through into the views heap file.

> If you really do need conditional rules, you can satisfy the check
> by writing one unconditional DO INSTEAD NOTHING rule and then one
> or more conditional non-INSTEAD rules. But you should think carefully
> about what you expect to happen when you use a conditional rule.

Alternatively he should be able to move the condition down
into the query itself. In that case, it's an unconditional
INSTEAD rule, causing the rewriter not to fork off another
query but replace the initial one completely. But the
condition is still there and affects the effects.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message <No Name> 2001-01-25 13:39:52 Wild Cards
Previous Message Brett W. McCoy 2001-01-25 12:28:57 Re: Re: Problem with Dates