Re: [HACKERS] Another RI question

Поиск
Список
Период
Сортировка
От Andreas Zeugswetter
Тема Re: [HACKERS] Another RI question
Дата
Msg-id 37E9F0E6.A88EFB66@telecom.at
обсуждение исходный текст
Ответы Re: [HACKERS] Another RI question  (wieck@debis.com (Jan Wieck))
Список pgsql-hackers
>     Is it ALLWAYS the case, that a FK constraint refers to the PK
>     of  another  table?  Or could arbitraty attributes of another
>     table be referenced by a FK too?

arbitrary (usually unique indexed) columns

>     Is it guaranteed that I find the PK  definition  of  a  table
>     allways in the index <tablename>_pkey?

No. I think there is a column in pg_index that marks a pk already.
(for odbc) This would imho be the best way.

>     Another (my preferred) way would be to name the automatically
>     created  PK  index  something like "pg_pkey_<tableoid>". This

You want to have the ability to:
1. create table
2. create unique index
3. alter table add constraint primary key (uses existing index)

The automatic naming should be irrelevant. 

Andreas


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

Предыдущее
От: Jose Antonio Cotelo lema
Дата:
Сообщение: Problems when opening large objects in the server side.
Следующее
От: "Hiroshi Inoue"
Дата:
Сообщение: RE: [HACKERS] IPC on win32 - additions for 6.5.2 and current trees