Search Postgresql Archives

Re: Sequence skipping values

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

 



On Fri, Feb 10, 2006 at 09:57:31AM -0800, Steve Crawford wrote:
> There is no guarantee that a sequence will be contiguous. For example, 
> begin...insert into...rollback  will not reset the sequence as other 
> transactions could have incremented the sequence.

Also, deleting records won't modify the sequence (unless a trigger
does so; the point is that the delete itself doesn't).  If you
delete the latest records in the table, the sequence will continue
from where it was after the last insert (more properly, after the
last call to nextval), not from the new highest value in the table.

Other possibilities, though less likely, are that the sequence has
non-default CACHE or INCREMENT values.

-- 
Michael Fuhr


[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