X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C7134476353 for ; Wed, 30 Apr 2003 10:23:11 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id A313C476361 for ; Wed, 30 Apr 2003 10:23:07 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 05526D61D; Wed, 30 Apr 2003 07:23:11 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id EF2FD5C0A; Wed, 30 Apr 2003 07:23:11 -0700 (PDT) Date: Wed, 30 Apr 2003 07:23:11 -0700 (PDT) From: Stephan Szabo To: Justin Long Cc: Subject: Re: Impact of loss of unique SERIAL? In-Reply-To: Message-ID: <20030430072030.M81999-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-25.8 required=5.0 tests=BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/399 X-Sequence-Number: 8554 On Wed, 30 Apr 2003, Justin Long wrote: > I am new to these lists and this message may be off-topic for this list. If > so, please advise and I will repost to one of the others. Here is the > question: > > We have been running Postgres 7.2.x for our website, and are considering the > upgrade to 7.3.x. However, in reading through the changelogs I notice that > SERIAL values are no longer unique. Now, I'm no SQL guru, but I'm wondering > what happens if two INSERTs are done at the "same" time (we have multiple > web hosts that access one large database server). Would they result in two > identical values on the SERIAL? We haven't gotten a stupendous amount of > traffic, so I don't know what the odds of this are, but I'm wondering why it > was removed. The values from the sequence still should be unique (even for two inserts at the "same" time) -- it's still a sequence, but it doesn't also add a unique constraint to the table in addition. You can add a unique constraint to the table with alter table if it's important (like the fact that you expect there to be an index on that or you want to reference that column and didn't specify it as unique/primary key).