X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4D7A04758E6 for ; Wed, 30 Apr 2003 10:35:09 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 9DE9A475458 for ; Wed, 30 Apr 2003 10:35:08 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h3UEZDU6022081; Wed, 30 Apr 2003 10:35:13 -0400 (EDT) To: "Justin Long" Cc: pgsql-admin@postgresql.org Subject: Re: Impact of loss of unique SERIAL? In-reply-to: References: Comments: In-reply-to "Justin Long" message dated "Wed, 30 Apr 2003 09:33:03 -0400" Date: Wed, 30 Apr 2003 10:35:12 -0400 Message-ID: <22080.1051713312@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-29.3 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,REFERENCES, 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/400 X-Sequence-Number: 8555 "Justin Long" writes: > 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. You misread it. SERIAL does not automatically create a unique index on the column anymore, but the sequence mechanism hasn't changed. If you want a unique index, you just say "SERIAL UNIQUE" instead of "SERIAL". The index is mainly useful as a backstop to guarantee you don't mess up (eg, by manually inserting values into the column rather than letting them be taken from the sequence). Some might see it as unnecessary overhead. regards, tom lane