alter views

From: "Sim Zacks" <sim(at)compulab(dot)co(dot)il>
To: pgsql-general(at)postgresql(dot)org
Subject: alter views
Date: 2005-05-10 09:37:50
Message-ID: d5ps0u$2u47$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

A couple months ago, I posted a function that allows a user to alter views
with dependencies.
I recently discovered another quick way to do it and thought I would share
it with the community.

1) Cretae a new view
2) Modify the dependent views to utilize the new view
3) drop the old view
4) rename the new view with the same name as the old view using alter table
viewname rename to newname

The views that referenced the newname automatically switch their reference
to the new name.
This is better for people who are uncomfortable with a function that first
drops the dependency list and then rebuilds them one at a time.

Browse pgsql-general by date

  From Date Subject
Next Message Julian Legeny 2005-05-10 09:41:50 ORDER BY options (how to order data as AAA, aaa, BBB, bbb, ... ZZZ, zzz)
Previous Message Ron Mayer 2005-05-10 09:02:22 Re: Array manipulation/syntax question