Small int autoincrement columns ?

Поиск
Список
Период
Сортировка
От Constantin Teodorescu
Тема Small int autoincrement columns ?
Дата
Msg-id 3649A2EA.138D97C0@flex.ro
обсуждение исходный текст
Список pgsql-hackers
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


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

Предыдущее
От: "Taral"
Дата:
Сообщение: RE: [HACKERS] CORBA interface in backend?
Следующее
От: Zsolt Varga
Дата:
Сообщение: Re: [HACKERS] linux libc6 & pgsql 6.4