Re: dependency on columns basis

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: dependency on columns basis
Дата
Msg-id 201108220806.17460.adrian.klaver@gmail.com
обсуждение исходный текст
Ответ на dependency on columns basis  (salah jubeh <s_jubeh@yahoo.com>)
Список pgsql-general
On Monday, August 22, 2011 7:47:47 am salah jubeh wrote:
> Hello,
>
> I have a lookup table I want to delete  which is referenced as a foreign
> key in another table.  Is there is a way to find all of the  tables
> depends on this column (foreign key) but not the whole table or view.
>
>
> Thanks in advance

In psql:
\d referenced_table

Example:

test(5432)aklaver=>\d fk_1
           Table "public.fk_1"
 Column  |       Type        | Modifiers
---------+-------------------+-----------
 id      | integer           | not null
 txt_fld | character varying |
Indexes:
    "fk_1_pkey" PRIMARY KEY, btree (id)
Referenced by:
    TABLE "fk_2" CONSTRAINT "fk_2_id2_fkey" FOREIGN KEY (id2) REFERENCES
fk_1(id) ON DELETE CASCADE


--
Adrian Klaver
adrian.klaver@gmail.com

В списке pgsql-general по дате отправления:

Предыдущее
От: salah jubeh
Дата:
Сообщение: dependency on columns basis
Следующее
От: Michael Nolan
Дата:
Сообщение: Re: securing the sql server ?