Re: 'Following' the Primary key

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Turbo Fredriksson <turbo(at)bayour(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 'Following' the Primary key
Date: 2002-03-14 13:19:19
Message-ID: 1016111959.18213.51.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Turbo Fredriksson 2002-03-14 13:28:37 Re: 'Following' the Primary key
Previous Message Turbo Fredriksson 2002-03-14 13:00:32 'Following' the Primary key