Skip site navigation (1) Skip section navigation (2)

Re: how to get dependancies of a table?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nobs(at)nobswolf(dot)info (Emil Obermayr)
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: how to get dependancies of a table?
Date: 2008-07-07 14:07:59
Message-ID: 9242.1215439679@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
nobs(at)nobswolf(dot)info (Emil Obermayr) writes:
> Instead I would prefer to see the dependancies. I have no idea where to
> look.

Fix whatever client you're using to not throw away NOTICE messages ...

regression=# create table foo (f1 int primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo"
CREATE TABLE
regression=# create table bar (d1 int references foo);
CREATE TABLE
regression=# create table baz (d1 int references foo);
CREATE TABLE
regression=# drop table foo;
NOTICE:  constraint baz_d1_fkey on table baz depends on table foo
NOTICE:  constraint bar_d1_fkey on table bar depends on table foo
ERROR:  cannot drop table foo because other objects depend on it
HINT:  Use DROP ... CASCADE to drop the dependent objects too.

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: Marc AbbottDate: 2008-07-08 04:11:19
Subject: Object Privileges
Previous:From: Emil ObermayrDate: 2008-07-07 08:18:02
Subject: how to get dependancies of a table?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group