Re: Rule not invoked in 7.1 - Mailing list pgsql-sql

From Jan Wieck
Subject Re: Rule not invoked in 7.1
Date
Msg-id 200101251321.IAA02253@jupiter.greatbridge.com
Whole thread Raw
In response to Re: Rule not invoked in 7.1  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Tom Lane wrote:
> Kyle <kyle@actarg.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@Yahoo.com #



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



pgsql-sql by date:

Previous
From: Roberto Bertolusso
Date:
Subject: Cannot CREATE INDEX that contains a function
Next
From: "Albert REINER"
Date:
Subject: Re: unreferenced primary keys: garbage collection