Re: how to find foreign key details (column, that is)

Поиск
Список
Период
Сортировка
От Karsten Hilbert
Тема Re: how to find foreign key details (column, that is)
Дата
Msg-id 20081214195739.GB8624@merkur.hilbert.loc
обсуждение исходный текст
Ответ на Re: how to find foreign key details (column, that is)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: how to find foreign key details (column, that is)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Sun, Dec 14, 2008 at 02:37:51PM -0500, Tom Lane wrote:
> Subject: Re: [GENERAL] how to find foreign key details (column, that is)
>
> Karsten Hilbert <Karsten.Hilbert@gmx.net> writes:
> > I cannot, however, for the life of it find out how to learn
> > the *column* the foreign key is on.
>
> pg_constraint.conkey has the referencing columns' numbers.

Tom, thanks, as usual awesome support on the 3rd Sunday in
Advent ...

This is what my 8.3 manual says:

conkey │ int2[] │ pg_attribute.attnum │ If a table constraint, list of columns which the constraint constrains │

From that I wouldn't have figured it'd apply to foreign keys
as well. So I assume it is fair to say that "foreign keys
are one type of table constraint", right ?

Thanks again,
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: how to find foreign key details (column, that is)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: how to find foreign key details (column, that is)