There are many cases when they are small lookup tables with few records
and detail tables with a lot of records.
In that cases it would be better to have an int2 autoincrement fields
for the lookup tables, not an int4.
create table goods(id int2 default nextval('goodies_seq'), name text);
does not work. Also,
create table goods(create table goods(id int2 default
nextval('goodies_seq'), name text);name text);
doesn't work either.
There is a chance to define a sql function next_goods_id returning int4
as 'select nextval('goodies_seq')::int2' but it isn't so nice.
BTW, shouldn't id int2 default nextval('goodies_seq')::int2 work ?
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA