Re: Adding a column to a VIEW which has dependent objects.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Adding a column to a VIEW which has dependent objects.
Date: 2004-01-10 16:48:45
Message-ID: 9810.1073753325@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Rajesh Kumar Mallah <mallah(at)trade-india(dot)com> writes:
> How do people extend a parent view which has
> lot of dependent views?
> The parent view cannot be dropped because that will
> require recreating a dozen of dependent views.

You're out of luck, you'll have to drop and remake them all.
In future we could think about some kind of ALTER VIEW ADD COLUMN
operation, but it ain't there now.

(I suppose if you were really desperate you could think about manually
hacking the system catalogs, but this would be pretty risky on a
production database.)

> Also is there an easy way of dumping the definitions
> of all the dependent views of a given object.

You can chase the links in pg_depend to see what the dependent objects
are, but extracting their definitions would be a tad harder ...

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jeff Eckermann 2004-01-10 18:28:38 Re: data loading
Previous Message Rajesh Kumar Mallah 2004-01-10 07:54:54 Adding a column to a VIEW which has dependent objects.