Finding the primary key of tables

Поиск
Список
Период
Сортировка
От George Silva
Тема Finding the primary key of tables
Дата
Msg-id AANLkTin5e4ybJHwVRO3R4JvM=Zb2RD+mH+=USjA5TiAy@mail.gmail.com
обсуждение исходный текст
Ответы Re: Finding the primary key of tables  (John R Pierce <pierce@hogranch.com>)
Re: Finding the primary key of tables  (Merlin Moncure <mmoncure@gmail.com>)
Re: Finding the primary key of tables  (Devrim GÜNDÜZ <devrim@gunduz.org>)
Список pgsql-general
Hello guys,

I'm building a function which needs to know what is the primary key of a certain table (all in pgplsql).

I was using select * from information_schema.key_column_usage where table_schema='foo' and table_name = 'aaa'; but that will give me multiple results in case of additional keys in the table.

Any suggestions?

--
George R. C. Silva

Desenvolvimento em GIS
http://blog.geoprocessamento.net

В списке pgsql-general по дате отправления:

Предыдущее
От: David Kerr
Дата:
Сообщение: Question about Idle in TX
Следующее
От: John R Pierce
Дата:
Сообщение: Re: Question about Idle in TX