| От | Adrian Klaver |
|---|---|
| Тема | Re: how to find primary key field name? |
| Дата | |
| Msg-id | 201110111602.52587.adrian.klaver@gmail.com обсуждение исходный текст |
| Ответ на | how to find primary key field name? ("J.V." <jvsrvcs@gmail.com>) |
| Список | pgsql-general |
On Tuesday, October 11, 2011 3:54:09 pm J.V. wrote: > 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? Join against constraint_column_usage?: http://www.postgresql.org/docs/9.1/interactive/infoschema-constraint-column- usage.html > > J.V. -- Adrian Klaver adrian.klaver@gmail.com
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера