pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Adding a column to a VIEW which has dependent objects.
3+ messages / 3 participants
[nested] [flat]

* Adding a column to a VIEW which has dependent objects.
@ 2004-01-10 07:54 Rajesh Kumar Mallah <mallah@trade-india.com>
  2004-01-10 16:48 ` Re: Adding a column to a VIEW which has dependent objects. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Rajesh Kumar Mallah @ 2004-01-10 07:54 UTC (permalink / raw)
  To: pgsql-sql


Dear PostgreSQL gurus,


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.

Is there any workaround.

Also is there an easy way of dumping the definitions
of all the dependent views of a given object. Does information_schema
helps here.


Regds
mallah.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Adding a column to a VIEW which has dependent objects.
  2004-01-10 07:54 Adding a column to a VIEW which has dependent objects. Rajesh Kumar Mallah <mallah@trade-india.com>
@ 2004-01-10 16:48 ` Tom Lane <tgl@sss.pgh.pa.us>
  2004-01-12 16:34   ` Re: Adding a column to a VIEW which has dependent objects. scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2004-01-10 16:48 UTC (permalink / raw)
  To: Rajesh Kumar Mallah <mallah@trade-india.com>; +Cc: pgsql-sql

Rajesh Kumar Mallah <mallah@trade-india.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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Adding a column to a VIEW which has dependent objects.
  2004-01-10 07:54 Adding a column to a VIEW which has dependent objects. Rajesh Kumar Mallah <mallah@trade-india.com>
  2004-01-10 16:48 ` Re: Adding a column to a VIEW which has dependent objects. Tom Lane <tgl@sss.pgh.pa.us>
@ 2004-01-12 16:34   ` scott.marlowe <scott.marlowe@ihs.com>
  0 siblings, 0 replies; 3+ messages in thread

From: scott.marlowe @ 2004-01-12 16:34 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Rajesh Kumar Mallah <mallah@trade-india.com>; pgsql-sql

On Sat, 10 Jan 2004, Tom Lane wrote:

> Rajesh Kumar Mallah <mallah@trade-india.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 ...

Note that the definitions for views are stored in pg_views as well.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-01-12 16:34 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-01-10 07:54 Adding a column to a VIEW which has dependent objects. Rajesh Kumar Mallah <mallah@trade-india.com>
2004-01-10 16:48 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-01-12 16:34   ` scott.marlowe <scott.marlowe@ihs.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox