Search Postgresql Archives

Re: sequences w/o holes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Dec 19, 2005, at 20:14 , Marian Naghen wrote:

Can anyones suggest some readings about implementing
sequences w/o holes ?

Check the mailing list archives. In short, if you want to guarantee no holes, you don't use sequences. IIRC, the process is:
1. Set up another table (foo) that holds the current value.
2. To grab a new value, increment the current value in foo and use the current value in your insert within a transaction.

If you delete rows from your table, you'll need to do some updating if you want to maintain having no holes.

Michael Glaesemann
grzm myrealbox com



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux