From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Long <justinlong@strategicnetwork.org>
Cc: pgsql-admin@postgresql.org
Subject: Re: Impact of loss of unique SERIAL?
Date: Wed, 30 Apr 2003 10:35:12 -0400
Message-ID: <22080.1051713312@sss.pgh.pa.us> (raw)
In-Reply-To: <HOEMINGMOAAKJBIFKNJMOENNKFAA.justinlong@strategicnetwork.org>
References: <HOEMINGMOAAKJBIFKNJMOENNKFAA.justinlong@strategicnetwork.org>
"Justin Long" <justinlong@strategicnetwork.org> 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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, justinlong@strategicnetwork.org
Subject: Re: Impact of loss of unique SERIAL?
In-Reply-To: <22080.1051713312@sss.pgh.pa.us>
References: <HOEMINGMOAAKJBIFKNJMOENNKFAA.justinlong@strategicnetwork.org> <22080.1051713312@sss.pgh.pa.us>
* 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