Re: How can I look at a recursive table dependency tree?

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How can I look at a recursive table dependency tree?
Date: 2009-05-29 16:10:22
Message-ID: 4A2008EE.20901@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

A. Kretschmer wrote:
> In response to Igor Katson :
>> I want to DROP CASCADE a table, but I am afraid that amoung numerous
>> recursive dependencies there will be smth, that I don't want to drop.
>>
>> Is there a way to watch all dependencies recursively without doing a drop?
>
> You can walk through pg_depend.

Is it possible to find all view names depend on one table?

For example,

create table t1;
create view v1 as select * from t1;
create view v2 as select ... from v1;

To get all dependencies based on t1:

returns

t1 | v1
t1 | v2

--
Lu Ying

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-05-29 16:22:28 Re: Transaction settings: nowait
Previous Message Tom Lane 2009-05-29 15:24:19 Re: optimize/cleanup SQL