Re: non instead rule system

From: jwieck(at)debis(dot)com (Jan Wieck)
To: andreas(dot)zeugswetter(at)telecom(dot)at (Andreas Zeugswetter)
Cc: hackers(at)postgresql(dot)org, jwieck(at)debis(dot)com
Subject: Re: non instead rule system
Date: 1998-08-14 10:01:53
Message-ID: m0z7GgD-000EBPC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> Jan wrote:
> I think there is no choice any longer. I'll start now
> removing all the non-instead rule stuff to make the rule
> system as reliable as can.
>
> Is this really necessary to get the instead stuff working ? If not, I think
> it would be good to keep it even if it is currently somewhat broken. Maybe someone
> wants to look it over later. The rule system is one hell of a concept with lots of
> diploma work at Berkeley behind it.
>
> Andreas

After I started now, I don't think any longer that it is
really necessary to remove all the non-instead stuff.

The RIR rules work, that's why the views work. What's missing
for the other rules (as far as I see it in the query
debugging now) is that RIR rules also have to be applied on
these queries first.

Having a view, you might want to define an update instead
rule that updates the real tables behind the view. The
parsers output for an update on the view references the view
itself in the rangetable and it's var nodes in targetList and
qual. Before processing the update rule, these must first be
substituted to what they really are (RTE's for the real
tables and the targetList and qual expressions from the RIR
rule of the view). As it is now, the query after rewriting
still uses the view itself in the qual expressions. This
results later in very complicated mergejoin and nestloop
plans, that in fact do nothing because they scan the view
somewhere and while thats an empty relation will never find a
single row.

I know now, that the RIR rules have to be taken to modify the
queries for insert, update and delete commands. Let's see
what happens if I got that and decide then how to move on.

Until later, Jan

--

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dr. Michael Meskes 1998-08-14 11:17:38 Define command
Previous Message Guido Piazzi 1998-08-14 09:36:57 Re: [GENERAL] More details on Database corruption