Re: VIEW problem

From: Jan Wieck <janwieck(at)Yahoo(dot)com>
To: Tim Uckun <tim(at)diligence(dot)com>
Cc: Horst Herb <hherb(at)malleenet(dot)net(dot)au>, pgsql-general(at)hub(dot)org
Subject: Re: VIEW problem
Date: 2000-10-05 12:38:46
Message-ID: 200010051238.HAA09272@jupiter.jw.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tim Uckun wrote:
> At 05:48 PM 10/5/2000 +1100, you wrote:
>
> >I believe this is because the OIDs are not identical. Internally, Postgres is
> >referring to the OIDs and not to the table name. Might be wrong, I am only a
> >postgres newbie, but I think this is the case.
>
> Interesting this makes sense.
>
> >I don't think it is a bug either, this is rather correct and prevents the
> >database from doing the wrong thing (your new table foo could be completely
> >different from the first table foo)
>
> Here I have to disagree with you. I can't believe that this behaviour was
> intended. A view is not materialized and it's simply a RULE which is to say
> that it's nothing more then a SQL statement. As long as that SQL statement
> is valid, parseable and returns a recordset it really ought not to care
> about oids.

You're right and this is a long standing - let's say lacking
capability instead of bug.

The problem is that the rules aren't stored as their queries
string representation, given in the original CREATE RULE
statement. Instead, the internal queries parsetree
representation is stored to avoid the need to parse the rules
any time they're used again. In the case of a DROP/CREATE of
an underlying object, this preparsed querytree becomes
invalid, so that the view would need to be recompiled, so to
say. But the system doesn't know the original definition any
more so it can't.

I have a personal TODO on this.

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 #

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Ansley 2000-10-05 13:19:40 Object syntax
Previous Message Nikolay Mijaylov 2000-10-05 12:21:07 FW: URGENT: pgsql on the web server - memory problems....