| От | Chris Mair |
|---|---|
| Тема | Re: Querying constraints? |
| Дата | |
| Msg-id | 1155237920.5893.50.camel@dell.home.lan обсуждение исходный текст |
| Ответ на | Querying constraints? (Lexington Luthor <Lexington.Luthor@gmail.com>) |
| Ответы |
Re: Querying constraints?
|
| Список | pgsql-sql |
> Is is possible to query from my application whether there is a primary > key or unique constraint on a given table and field name(s)? Curiously enough, I just answered a similar question on the pgsql-admin list. Try this: SELECT c.relname as table, r.conname as contraint_name, r.contype as contraint_type, pg_catalog.pg_get_constraintdef(r.oid, true) as constraint_definition FROM pg_catalog.pg_constraint r, pg_catalog.pg_class c WHERE c.oid = r.conrelid; Bye, Chris -- Chris Mair http://www.1006.org
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера