From: DalTech - Continuing Technical Education <CTE@Dal.Ca>
To: kparker@eudoramail.com
Cc: pgsql-sql@hub.org
Subject: Re: Re: unique sequences
Date: Tue, 27 Jun 2000 08:12:16 -0300
Message-ID: <006601bfe028$8da6dd60$5911be86@cte.Dal.Ca> (raw)
References: <LJEBLKFCBIGCGAAA@shared1-mail.whowhere.com>
I imagine it should if you create a unique index on the field.
Cheers,
Christopher Currie
----- Original Message -----
From: K Parker <kparker@eudoramail.com>
To: <pgsql-sql@hub.org>
Sent: Tuesday, June 27, 2000 1:52 AM
Subject: [SQL] Re: unique sequences
> > Rather, each time you wish to do an insert,
> > query the existing data to see what the
> > maximum value is existing in the database.
> > Add 1 to that and use this as your new value.
> > This is guaranteed to not have any holes in
> > the sequence.
>
> True, but alas it _doesn't_ guarantee uniqueness, since there's nothing to
prohibit 2 or more back ends getting the same max() at the
> same time...
>
> Thinking off the top of my head, I'm not sure you can apply FOR UPDATE to
an aggregate function, so there's probably no solution there, either.
>
>
>
> Join 18 million Eudora users by signing up for a free Eudora Web-Mail
account at http://www.eudoramail.com
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-sql@postgresql.org
Cc: CTE@Dal.Ca, kparker@eudoramail.com, pgsql-sql@hub.org
Subject: Re: unique sequences
In-Reply-To: <006601bfe028$8da6dd60$5911be86@cte.Dal.Ca>
References: <LJEBLKFCBIGCGAAA@shared1-mail.whowhere.com> <006601bfe028$8da6dd60$5911be86@cte.Dal.Ca>
* 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