Re: sequence increment jumps? - Mailing list pgsql-general

From Douglas McNaught
Subject Re: sequence increment jumps?
Date
Msg-id 87y7nqgbdo.fsf@suzuka.mcnaught.org
Whole thread Raw
In response to Re: sequence increment jumps?  (Benjamin Smith <lists@benjamindsmith.com>)
Responses Re: sequence increment jumps?
List pgsql-general
Benjamin Smith <lists@benjamindsmith.com> writes:

> On Thursday 25 January 2007 09:53, Douglas McNaught wrote:
>> Nature of the beast.  Sequence increments aren't rolled back on
>> transaction abort (for performance and concurrency reasons), so you
>> should expect gaps.
>
> Behavior long ago noted and accounted for. But I've always wondered why this
> was so? Is there a specific reason for this behavior?

Being able to roll back a sequence increment would require locking the
sequence for the duration of the transaction, which would kill
concurrency.

-Doug

pgsql-general by date:

Previous
From: Benjamin Smith
Date:
Subject: Re: Converting 7.x to 8.x
Next
From: "Jeremy Haile"
Date:
Subject: Re: Stats collector frozen?