question on viewing dependencies

Started by Aaron Burnettabout 17 years ago3 messagesgeneral
Jump to latest
#1Aaron Burnett
aburnett@bzzagent.com

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Aaron Burnett (#1)
Re: question on viewing dependencies

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

#3Aaron Burnett
aburnett@bzzagent.com
In reply to: Tom Lane (#2)
Re: question on viewing dependencies

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:

Show quoted text

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