pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-admin@postgresql.org
Subject: Re: how to get fy info from the parent table
Date: Fri, 4 Jul 2008 17:43:48 +0300
Message-ID: <200807041743.48920.achill@matrix.gatewaynet.com> (raw)
In-Reply-To: <191205.16325.qm@web56414.mail.re3.yahoo.com>
References: <191205.16325.qm@web56414.mail.re3.yahoo.com>

Στις Friday 04 July 2008 16:57:20 ο/η Jessica Richard έγραψε:
> 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 the kids.
 
> >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



view thread (2+ messages)

Message-ID: <200807041743.48920.achill@matrix.gatewaynet.com>
Permalink:  ../200807041743.48920.achill@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/200807041743.48920.achill@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: achill@matrix.gatewaynet.com
  Subject: Re: how to get fy info from the parent table
  In-Reply-To: <200807041743.48920.achill@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox