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 7A983D9C60 for ; Tue, 4 Oct 2005 19:52:51 -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 08296-08 for ; Tue, 4 Oct 2005 22:52:47 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [67.100.216.10]) by svr1.postgresql.org (Postfix) with ESMTP id 6263DD946C for ; Tue, 4 Oct 2005 19:52:47 -0300 (ADT) Received: by flake.decibel.org (Postfix, from userid 1001) id BEDCA15255; Tue, 4 Oct 2005 17:52:50 -0500 (CDT) Date: Tue, 4 Oct 2005 17:52:50 -0500 From: "Jim C. Nasby" To: Scott Marlowe Cc: Tom Lane , fmiddleton@verizon.net, pgsql-sql@postgresql.org Subject: Re: Why doesn't the SERIAL data type automatically have a Message-ID: <20051004225250.GN40138@pervasive.com> References: <4338961E.20100@verizon.net> <5899.1127782998@sss.pgh.pa.us> <1127835194.29347.12.camel@state.g2switchworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1127835194.29347.12.camel@state.g2switchworks.com> X-Operating-System: FreeBSD 4.11-RELEASE-p10 i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 required=5 tests=[AWL=0.008] X-Spam-Level: X-Archive-Number: 200510/13 X-Sequence-Number: 22866 On Tue, Sep 27, 2005 at 10:33:14AM -0500, Scott Marlowe wrote: > On Mon, 2005-09-26 at 20:03, Tom Lane wrote: > > Ferindo Middleton Jr writes: > > > Is there some reason why the SERIAL data type doesn't automatically have > > > a UNIQUE CONSTRAINT. > > > > It used to, and then we decoupled it. I don't think "I have no use for > > one without the other" translates to an argument that no one has a use > > for it ... > > I have to admit, right after the change was made, I was of the opinion > that no one would ever need that. Then, a few months later, it was > exactly what I needed for some project... :) Arguably it would have been better to make the default case add either UNIQUE or PRIMARY KEY with a way to over-ride. If newbies are getting burned maybe it would be useful to toss a NOTICE or maybe even WARNING when a serial is created without a unique constraint of some kind? -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461