Re: sequence skips 30 values, how? - Mailing list pgsql-general

From Jorge Godoy
Subject Re: sequence skips 30 values, how?
Date
Msg-id 877iv2ngs4.fsf@gmail.com
Whole thread Raw
In response to Re: sequence skips 30 values, how?  ("Angva" <angvaw@gmail.com>)
List pgsql-general
"Angva" <angvaw@gmail.com> writes:

> As others have said, sequences can have gaps. In fact, the thought of
> a gap-free sequence is scary to me. Unless you do very few inserts,
> "gap-free sequence" is pretty much synonymous with "not scalable". If
> your goal is to generate a unique number for each row (which is
> usually the case), then gaps should be fine.
>
> Though I must admit I have occasionally wished for sequences with a
> GAPFREE option...For small, static look-up tables that I update once
> in a blue moon. It's just easier on the eyes to have 1,2,3,4,5 than 1,
> 25, 2405, 95720, 59028598253.

There's a recipe for gapless sequences on Varlena (if you can access it from
your end...) that was the result of discussions here.  There's a performance
hit, of course, but it works.

--
Jorge Godoy      <jgodoy@gmail.com>

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: PG Email Client
Next
From: Adrian Klaver
Date:
Subject: Re: How can I list the function.