Re: Sequence skipping values - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Sequence skipping values
Date
Msg-id 20060210184136.GA2837@winnie.fuhr.org
Whole thread Raw
In response to Re: Sequence skipping values  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: David Rio Deiros
Date:
Subject: Re: distinct not working in a multiple join
Next
From: Tony Caduto
Date:
Subject: Re: Tool