X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B66BCD9818 for ; Mon, 26 Sep 2005 21:44:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 47876-07 for ; Tue, 27 Sep 2005 00:44:06 +0000 (GMT) Received: from vms048pub.verizon.net (vms048pub.verizon.net [206.46.252.48]) by svr1.postgresql.org (Postfix) with ESMTP id 603A4D9835 for ; Mon, 26 Sep 2005 21:44:07 -0300 (ADT) Received: from [192.168.1.12] ([68.239.68.205]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0ING00590A1MP4H7@vms048.mailsrvcs.net> for pgsql-sql@postgresql.org; Mon, 26 Sep 2005 19:44:11 -0500 (CDT) Date: Mon, 26 Sep 2005 20:45:18 -0400 From: Ferindo Middleton Jr Subject: Why doesn't the SERIAL data type automatically have a UNIQUE CONSTRAINT To: pgsql-sql@postgresql.org Reply-To: fmiddleton@verizon.net Message-id: <4338961E.20100@verizon.net> Organization: Sleek Collar MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit User-Agent: Thunderbird 1.4 (Windows/20050908) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.361 required=5 tests=[AWL=-0.389, DNS_FROM_RFC_ABUSE=0.374, DNS_FROM_RFC_POST=1.376] X-Spam-Level: * X-Archive-Number: 200509/257 X-Sequence-Number: 22804 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