Re: idea: storing view source in system catalogs

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Merlin Moncure <mmoncure(at)gmail(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: idea: storing view source in system catalogs
Date: 2008-07-14 22:57:09
Message-ID: 200807142257.m6EMv9k19793@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Added to TODO:

* Improve ability to modify views via ALTER TABLE

http://archives.postgresql.org/pgsql-hackers/2008-05/msg00691.php

---------------------------------------------------------------------------

Robert Haas wrote:
> I think the real problem here is that PostgreSQL is very finicky about
> what operations you can perform on a view. If I have a table foo and
> I define a view bar that uses foo and a view baz that uses bar, I can
> add a column to foo without a problem, and, similarly, I can also drop
> or alter a column in foo that is not used by bar. But the same is not
> true of bar. I can't make any changes at all to bar without dropping
> and recreating it, and that means I have to drop and recreate baz as
> well. If there are only two views involved, this is not so bad, but
> frequently there are a whole slough of views baz1, baz2, ..., bazn
> that all depend on bar, and I have to drop and recreate every single
> one of them.
>
> I could understand the need to do this if I were (for example)
> changing the type of some column that was used by all of these views,
> but that's usually not the case. Normally I'm just adding new columns
> to foo and bar, and none of the other views are changing... but they
> have to be recreated anyway.
>
> As a side note, handling this problem gracefully would go a long way
> to solving the original poster's concern about *-expansion. If
> updating to the latest version of "*" just required re-executing
> CREATE OR REPLACE VIEW ..., it would be relatively simple. As things
> stand now, it requires DROP VIEW ... CASCADE; CREATE OR REPLACE VIEW
> ...; followed by recreating all of the dependent objects.
>
> ...Robert
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2008-07-14 23:02:28 Re: Exposing quals
Previous Message Bruce Momjian 2008-07-14 22:51:48 pgsql: Add column storage type to psql \d+ display.