Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT

Поиск
Список
Период
Сортировка
От Ferindo Middleton Jr
Тема Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT
Дата
Msg-id 4338961E.20100@verizon.net
обсуждение исходный текст
Ответы Re: Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Is there some reason why the SERIAL data type doesn't automatically have 
a UNIQUE CONSTRAINT. It seems that the main reason for using it is so 
that the value for this field keeps changing automatically and is never 
null so any one record can be identified using it- So why not imply that 
it is always be UNIQUE anyway. I mean, if you were to force another 
value on a SERIAL field that already had that same value, the would 
through the sequence tracking the the fields current value off any way, 
so it just makes sense to me to not let a serial field be duplicated. 
Let's take a poll. Is there anyone out there who actually uses the 
SERIAL data type who would not want it to be UNIQUE?

Ferindo


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

Предыдущее
От: jeff sacksteder
Дата:
Сообщение: how to do 'deep queries'?
Следующее
От: "Stewart Ben (RBAU/EQS4) *"
Дата:
Сообщение: Re: how to do 'deep queries'?