Re: How can I look at a recursive table dependency tree? - Mailing list pgsql-general

From Emi Lu
Subject Re: How can I look at a recursive table dependency tree?
Date
Msg-id 4A2008EE.20901@encs.concordia.ca
Whole thread Raw
In response to Re: How can I look at a recursive table dependency tree?  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Responses Re: How can I look at a recursive table dependency tree?  (Greg Stark <stark@enterprisedb.com>)
List 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: optimize/cleanup SQL
Next
From: Scott Marlowe
Date:
Subject: Re: Transaction settings: nowait