Обсуждение: how to get primary / unique key on table ?

Поиск
Список
Период
Сортировка

how to get primary / unique key on table ?

От
"Ahmad Munif"
Дата:
how to get field on table that primary/unique key ?
does postgres have function to get that field name ?

thanks



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

От
Alvaro Herrera
Дата:
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.