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

Re: Again: How do I select primary/foreign keys?

From: Chris Smith <csmith(at)squiz(dot)net>
To: ffrt <ffrt(at)ace(dot)ulyssis(dot)org>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Again: How do I select primary/foreign keys?
Date: 2001-06-07 22:51:30
Message-ID: 4.3.2.7.2.20010608084554.00e97a90@cooee.cybersydney.com.au (view raw or flat)
Thread:
Lists: pgsql-novice
Hey,

The pg_indexes view might give you a starting point, also the pg_tables 
view. You can see what they do, and take it from there.

HTH.

>Hi again and sorry for the overhead,
>
>it seems I didn't express myself 100% clearly. I need a SELECT statement
>that will give me, for a given table (pg_class.relname='...'), the name of
>the column (pg_attribute.attname) that contains the primary key (if any),
>and the names of the columns that contain foreign keys.
>
>I can't seem to get there quite yet.

----------------------
      Chris Smith
http://www.squiz.net/ 


In response to

pgsql-novice by date

Next:From: Chris SmithDate: 2001-06-07 23:01:08
Subject: Re: 2 novice questions
Previous:From: Sykora, DaleDate: 2001-06-07 22:39:17
Subject: 2 novice questions

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