Re: Finding the primary key of tables

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: Finding the primary key of tables
Дата
Msg-id 4C586E42.4060009@hogranch.com
обсуждение исходный текст
Ответ на Finding the primary key of tables  (George Silva <georger.silva@gmail.com>)
Список pgsql-general
  On 08/03/10 12:13 PM, George Silva wrote:
> 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.

the primary key index is called tablename_pkey ... afaik, this is the
only thing that makes it special, otherwise, its just another index with
a unique constraint.



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

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