Re: Best approach for a "gap-less" sequence - Mailing list pgsql-general

From Jorge Godoy
Subject Re: Best approach for a "gap-less" sequence
Date
Msg-id 87d5b6ax1t.fsf@ieee.org
Whole thread Raw
In response to Re: Best approach for a "gap-less" sequence  ("chris smith" <dmagick@gmail.com>)
List pgsql-general
"chris smith" <dmagick@gmail.com> writes:

> Why does it matter?
>
> I assume there is a reason you need it like this..

Of course there is.  It is a project requirement and also a law requirement
that there's no unused number and that they be chronologically ordered as
well.  This is also part of the documented procedure that existed in paper and
that got ISO 9001 certified (so a lot of money was spent here before).  The
law requirement is the strongest reason, though.

After a number is assigned, it can't be changed, reused or have anything
"newer" in a 'previous' (numerically-wise) entry.

Concurrency is a problem since there might be a lot of people using it.  I
wanted to see if there was something that could improve performance here or to
solve the problem in a better way without locking the table.


Thanks,
--
Jorge Godoy      <jgodoy@gmail.com>


pgsql-general by date:

Previous
From: "Harpreet Dhaliwal"
Date:
Subject: Re: Connection Object
Next
From: "Sandeep Kumar Jakkaraju"
Date:
Subject: Re: Connection Object