Re: how to set more than two attributes as primary keys in a table

Поиск
Список
Период
Сортировка
От Casey Allen Shobe
Тема Re: how to set more than two attributes as primary keys in a table
Дата
Msg-id 200312291035.54017.cshobe@softhome.net
обсуждение исходный текст
Ответ на Re: how to set more than two attributes as primary keys in a table  (Bruno Wolff III <bruno@wolff.to>)
Ответы Re: how to set more than two attributes as primary keys in a table
Список pgsql-novice
Bruno Wolff III (Sunday 28 December 2003 23:24)
>   primary key (Region_Num, Num_Players)

You might also find unique () to be very helpful.  I personally prefer to
always have an id column as the primary key in any table, and to further
constrain the table with unique's, where necessary.

create table foobar (
    id    bigint default nextval(foobar_seq),
    foo    varchar(32),
    bar    smallint,
    foob    text,
    primary key (id),
    unique (foo, bar)
);

Vertu sæll,

--
Sigþór Björn Jarðarson (Casey Allen Shobe)
http://rivyn.livejournal.com

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: how to set more than two attributes as primary keys in a table
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: how to set more than two attributes as primary keys in a table