Обсуждение: question on viewing dependencies

Поиск
Список
Период
Сортировка

question on viewing dependencies

От
Aaron Burnett
Дата:
Hi,

postgresql version 8.25 running on RHEL4

Hopefully a quick answer. Went to drop a table:

drop table table_foo;
ERROR:  cannot drop table table_foo because other objects depend on it
HINT:  Use DROP ... CASCADE to drop the dependent objects too.

Wanted to see what the dependencies were:

BEGIN;
drop table table_foo CASCADE;
DROP TABLE
ROLLBACK;

Am I overlooking a step to actually seeing the dependant objects?

Thanking you in advance,

Aaron





Re: question on viewing dependencies

От
Tom Lane
Дата:
Aaron Burnett <aburnett@bzzagent.com> writes:
> Hopefully a quick answer. Went to drop a table:

> drop table table_foo;
> ERROR:  cannot drop table table_foo because other objects depend on it
> HINT:  Use DROP ... CASCADE to drop the dependent objects too.

> Wanted to see what the dependencies were:

> BEGIN;
> drop table table_foo CASCADE;
> DROP TABLE
> ROLLBACK;

> Am I overlooking a step to actually seeing the dependant objects?

Maybe you have client_min_messages set to suppress NOTICEs?

            regards, tom lane

Re: question on viewing dependencies

От
Aaron Burnett
Дата:
Thanks Tom,

It was not supressed for notice, so I changed it to 'debug1' and it gave me
the answers I was looking for.


On 2/22/09 6:07 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:

> Aaron Burnett <aburnett@bzzagent.com> writes:
>> Hopefully a quick answer. Went to drop a table:
>
>> drop table table_foo;
>> ERROR:  cannot drop table table_foo because other objects depend on it
>> HINT:  Use DROP ... CASCADE to drop the dependent objects too.
>
>> Wanted to see what the dependencies were:
>
>> BEGIN;
>> drop table table_foo CASCADE;
>> DROP TABLE
>> ROLLBACK;
>
>> Am I overlooking a step to actually seeing the dependant objects?
>
> Maybe you have client_min_messages set to suppress NOTICEs?
>
> regards, tom lane
>