Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT - Mailing list pgsql-sql

From Ferindo Middleton Jr
Subject Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT
Date
Msg-id 4338961E.20100@verizon.net
Whole thread Raw
Responses Re: Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT
List 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 by date:

Previous
From: jeff sacksteder
Date:
Subject: how to do 'deep queries'?
Next
From: "Stewart Ben (RBAU/EQS4) *"
Date:
Subject: Re: how to do 'deep queries'?