how to get primary / unique key on table ?

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

how to get primary / unique key on table ?

От:
"Ahmad Munif" <munif@hotpop.com>
Дата:
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 <alvherre@atentus.com>
Дата:
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 ()
www.google.com: interfaz de linea de comando para la web.

FAQ