referencing a `serial' column as a foreign key

Поиск
Список
Период
Сортировка
От Arcady Genkin
Тема referencing a `serial' column as a foreign key
Дата
Msg-id 87vh07giwo.fsf@tea.thpoon.com
обсуждение исходный текст
Список pgsql-novice
What would be the correct data type for a foreign key column that
references a `serial' column in another table? E.g.:

create table labels ( labelid serial );
create table disks (
       diskid serial,
       labelid int4 references labels ( labelid ) );

The above works (serial is a 4-byte numerical type in 7.0), but I'm
concerned if this is the right way to do it... What if implementation
of `serial' type changes in future releases?

Thanks,
--
Arcady Genkin                                 http://www.thpoon.com
Nostalgia isn't what it used to be.

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

Предыдущее
От: "D. Duccini"
Дата:
Сообщение: Re: opening old database
Следующее
От: Thomas Tynan
Дата:
Сообщение: running Postgresql on Mandrake 7.0