Re: how to set more than two attributes as primary keys in a table
В списке pgsql-novice по дате отправления:
| От | Bruno Wolff III |
|---|---|
| Тема | Re: how to set more than two attributes as primary keys in a table |
| Дата | |
| Msg-id | 20031229171427.GA9888@wolff.to обсуждение исходный текст |
| Ответ на | Re: how to set more than two attributes as primary keys in a table (Casey Allen Shobe <cshobe@softhome.net>) |
| Ответы |
Re: how to set more than two attributes as primary keys in a table
|
| Список | pgsql-novice |
On Mon, Dec 29, 2003 at 10:35:54 -0500, Casey Allen Shobe <cshobe@softhome.net> wrote: > 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) > ); Note that isn't quite the same unless you add NOT NULL constraints for foo and bar.
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера