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
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера