Thread: referencing a `serial' column as a foreign key

referencing a `serial' column as a foreign key

From
Arcady Genkin
Date:
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.