how to find primary key field name?

Поиск
Список
Период
Сортировка
От J.V.
Тема how to find primary key field name?
Дата
Msg-id 4E94C911.6030003@gmail.com
обсуждение исходный текст
Ответы Re: how to find primary key field name?  (Adrian Klaver <adrian.klaver@gmail.com>)
Re: how to find primary key field name?  (Joe Abbate <jma@freedomcircle.com>)
Re: how to find primary key field name?  (Stephen Cook <sclists@gmail.com>)
Re: how to find primary key field name?  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Re: how to find primary key field name?  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Список pgsql-general
If I have a table name, I know how to find the primary key constraint
name, but see no way to find the primary key field name.

select constraint_name from information_schema.tabale_constraints where
table_name = <table_name> and constraint_type = 'PRIMARY KEY';

will return the constraint name, but given the table_name and the
constraint_name, how do I find the database column/field name associated
with that primary key?

J.V.

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

Предыдущее
От: Sean Laurent
Дата:
Сообщение: Re: Postgres 9.01, Amazon EC2/EBS, XFS, JDBC and lost connections
Следующее
От: Sean Laurent
Дата:
Сообщение: Re: Postgres 9.01, Amazon EC2/EBS, XFS, JDBC and lost connections