Re: how to get primary / unique key on table ?

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Ahmad Munif <munif(at)hotpop(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to get primary / unique key on table ?
Date: 2002-08-04 05:19:52
Message-ID: Pine.LNX.4.44.0208040115190.29827-100000@cm-lcon1-46-187.cm.vtr.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ahmad Munif dijo:

> how to get field on table that primary/unique key ?
> does postgres have function to get that field name ?

You can look it up in system catalogs. Fire up psql -E and do a
\d sometable

The last query looks up indexes. You can poke around some more to get
the information you need.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
www.google.com: interfaz de linea de comando para la web.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2002-08-04 05:25:37 Re: Index scan ???
Previous Message Alvaro Herrera 2002-08-04 04:55:15 Re: Searching accented words