Hi again and sorry for the overhead, it seems I didn't express myself 100% clearly. I need a SELECT statement that will give me, for a given table (pg_class.relname='...'), the name of the column (pg_attribute.attname) that contains the primary key (if any), and the names of the columns that contain foreign keys. I can't seem to get there quite yet. Wim -- ffrt (pgp public key on simple request) Key fingerprint: FE F8 D4 63 A5 93 98 80 AC 7F 95 C1 85 6E 39 53
Hey,
The pg_indexes view might give you a starting point, also the pg_tables
view. You can see what they do, and take it from there.
HTH.
>Hi again and sorry for the overhead,
>
>it seems I didn't express myself 100% clearly. I need a SELECT statement
>that will give me, for a given table (pg_class.relname='...'), the name of
>the column (pg_attribute.attname) that contains the primary key (if any),
>and the names of the columns that contain foreign keys.
>
>I can't seem to get there quite yet.
----------------------
Chris Smith
http://www.squiz.net/
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера