pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ferindo Middleton Jr <fmiddleton@verizon.net>
To: pgsql-sql@postgresql.org
Subject: Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT
Date: Mon, 26 Sep 2005 20:45:18 -0400
Message-ID: <4338961E.20100@verizon.net> (raw)

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



view thread (10+ messages)  latest in thread

Message-ID: <4338961E.20100@verizon.net>
Permalink:  ../4338961E.20100@verizon.net/
Also on:    postgresql.org/message-id/4338961E.20100@verizon.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: fmiddleton@verizon.net
  Subject: Re: Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT
  In-Reply-To: <4338961E.20100@verizon.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox