Re: Invalidating dependent views and functions

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Scott Bailey <artacus(at)comcast(dot)net>, hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Invalidating dependent views and functions
Date: 2010-05-02 03:20:44
Message-ID: AANLkTin6-mG8ZaHqxK-k2_HGXIB3xoT8v5ZTfU7XV69B@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 30, 2010 at 10:38 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Scott Bailey <artacus(at)comcast(dot)net> writes:
>> Proposal: Add an invalid flag to pg_class. Invalid objects would be
>> ignored when doing dependency checks for DDL statements. And an
>> exception would be thrown when an invalid object is called.
>
> IMO, the way Oracle does this pretty much sucks, and shouldn't be
> emulated.  If they know how to recompile the view, why don't they
> just do it?  What you describe is about as user-unfriendly as it
> gets.

I agree that the way Oracle does it pretty much sucks. On the other
hand, I also sympathize with the OP's difficulties in managing a large
nest of views. I'm not really sure what can be done to improve the
situation, but it would be nice to come up with some better ideas. It
would almost be nice if there were a way to do ALTER TABLE ... ALTER
COLUMN ... TYPE ... CASCADE and have it trickle down into the
dependent views, but that might be too much black magic (or just too
hard to implement). Still, I don't really have a better idea.

...Robert

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-05-02 03:23:28 Re: pg_migrator to /contrib in a later 9.0 beta
Previous Message Robert Haas 2010-05-02 03:09:23 Re: Add column if not exists (CINE)