On Thu, 2002-03-14 at 13:00, Turbo Fredriksson wrote: > With '\d table' I get the columns, types and modifiers. Also > the Primary key, Indexes etc are shown. > > But if I want to know WHAT the primary key 'is pointing to', > how would I do that (ie, what is the primary key)?
Just do \d again on the key index name: bray=# \d org_contact Table "org_contact" Column | Type | Modifiers ---------+-----------------------+----------- org | character varying(10) | not null contact | character varying(10) | not null role | text | not null address | integer | Primary key: org_contact_pkey Triggers: RI_ConstraintTrigger_6933120, RI_ConstraintTrigger_6933114, RI_ConstraintTrigger_6933108 bray=# \d org_contact_pkey Index "org_contact_pkey" Column | Type ---------+----------------------- org | character varying(10) contact | character varying(10) unique btree (primary key) -- Oliver Elphick [EMAIL PROTECTED] Isle of Wight http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C "Let your light so shine before men, that they may see your good works, and glorify your Father which is in heaven." Matthew 5:16 ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html