pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <janwieck@Yahoo.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kyle <kyle@actarg.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Rule not invoked in 7.1
Date: Thu, 25 Jan 2001 08:21:09 -0500 (EST)
Message-ID: <200101251321.IAA02253@jupiter.greatbridge.com> (raw)
In-Reply-To: <26488.980398409@sss.pgh.pa.us>

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




view thread (10+ messages)  latest in thread

Message-ID: <200101251321.IAA02253@jupiter.greatbridge.com>
Permalink:  ../200101251321.IAA02253@jupiter.greatbridge.com/
Also on:    postgresql.org/message-id/200101251321.IAA02253@jupiter.greatbridge.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: janwieck@Yahoo.com, tgl@sss.pgh.pa.us, kyle@actarg.com
  Subject: Re: Rule not invoked in 7.1
  In-Reply-To: <200101251321.IAA02253@jupiter.greatbridge.com>
  References: <26488.980398409@sss.pgh.pa.us> <200101251321.IAA02253@jupiter.greatbridge.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox