Search Postgresql Archives

Re: dependency on columns basis

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux