Altering Views

From: Misa Simic <misa(dot)simic(at)gmail(dot)com>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Altering Views
Date: 2013-02-20 16:25:41
Message-ID: CAH3i69=jcnWw5rANYdfGXFfAEEgHKC5OAx7cbmU7-nLd2O8pFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

If we want to "add new column" to the view - the only one way (we have
found) is:

-drop view
-create it again ( with new column )

Now, if some other view depends on the view we want change - it will not
allow us to drop the view - what is fine, of course - but it does not allow
us to change it either (add column) even our change has not any effect on
other views what depend on this one...

So what we are doing is:

1. Take create scripts of all others views what depends on this one
2. Take create scripts of all others views what depends on any of views in
point 1 (recursively)

3. Drop the view (cascaded)

4. Create the view with the new column
5. Run create scripts taken from point 1 and 2...

Lot of hassle - just because of adding one more column to the view...

Is there any better way to alter view without hassle ?

If not - Are there any plans to allow it?

Many Thanks,

Misa

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2013-02-20 16:26:10 Re: Materialized views WIP patch
Previous Message Tom Lane 2013-02-20 16:20:41 Re: Materialized views WIP patch