Unix Technical Forum

how to get fy info from the parent table

This is a discussion on how to get fy info from the parent table within the pgsql Admins forums, part of the PostgreSQL category; --> Could some one tell me how to check this pk/fy thing please? From the parent table, I can see ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-04-2008, 03:38 PM
Jessica Richard
 
Posts: n/a
Default how to get fy info from the parent table

Could some one tell me how to check this pk/fy thing please?

From the parent table, I can see only the primary key there, now I wan to know how many and what other foreign keys are referencing this primary key... did this check long time ago and totally forgot how I did it then....

Thanks a log,
Jessica




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-04-2008, 03:38 PM
Achilleas Mantzios
 
Posts: n/a
Default Re: how to get fy info from the parent table

Στις Friday 04 July 2008 16:57:20 ο/η JessicaRichard *γραψε:
> Could some one tell me how to check this pk/fy thing please?
>


smth like
SELECT kid.relname as "KID",c.confrelid,c.conkey,c.confkey,f.relname as "DAD"
FROM pg_catalog.pg_constraint c,pg_catalog.pg_class f,pg_catalog.pg_class kid WHERE
c.contype = 'f' AND c.confrelid = f.oid AND c.conrelid=kid.oid AND f.relname='vessels';

could be your friend. substitute vessels with your "DAD" table, to find thekids.

> >From the parent table, I can see only the primary key there, now I wan to know how many and what other foreign keys are referencing this primary key... did this check long time ago and totally forgot how I did it then....

>
> Thanks a log,
> Jessica
>
>
>
>




--
Achilleas Mantzios

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:52 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com