Re: guaranteeing that a sequence never skips (fwd) - Mailing list pgsql-general

From Mike Nolan
Subject Re: guaranteeing that a sequence never skips (fwd)
Date
Msg-id 200410032023.i93KNHGO022319@gw.tssi.com
Whole thread Raw
In response to Re: guaranteeing that a sequence never skips (fwd)  (Christopher Browne <cbbrowne@acm.org>)
List pgsql-general
> Then, every once in a while, a separate process would go in, see the
> highest value on idfield < 250M, and rewrite the idfield on all of the
> tuples where idfield > 250M.  It would be efficient due to the partial
> index.  It limits the number of documents to 250M, but I'm sure that
> can be alleviated when it turns into an issue...

I think you'd be better off using two columns.  Call the first one the
'work ticket' for the check request, and you don't really care if it has gaps
in it or not, its primary purpose is to ensure that each check request
has a unique document number of some kind, so a sequence works fine.

One and only one program assigns the actual check numbers--in a separate
column.

That's the sort of thing that most commercial packages do, even though it
seems clumsy and adds an extra step, and that's why they do it that way, too.
--
Mike Nolan

pgsql-general by date:

Previous
From: Scott Ribe
Date:
Subject: Re: Out of memory errors on OS X
Next
From: Gaetano Mendola
Date:
Subject: Re: VACUUM FULL on 24/7 server