Re: BUG #6258: Lock Sequence - Mailing list pgsql-bugs

From Jaime Casanova
Subject Re: BUG #6258: Lock Sequence
Date
Msg-id CAJKUy5jHxRa7hYZFSgk-+oVGLdtsh5JcG1HuPU_WPTP_QmCqAQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #6258: Lock Sequence  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #6258: Lock Sequence  (Laerson keler <laerson.keler@lkmc.com.br>)
List pgsql-bugs
On Mon, Oct 17, 2011 at 2:43 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> There really is not any way to generate guaranteed-hole-free sequences
> using sequence objects. =A0If you have to have that, I'd suggest locking
> the table against other writes and then fetching MAX(id) + 1. =A0It's not
> very fast, and it's not at all concurrent, but that's the price of
> ensuring no holes. =A0Personally I'd rethink how badly you need that
> property.
>

another option is to create a table to use as a sequence, and lock
that table everytime you need a new value... is not concurrent also,
but at least faster... unless i'm missing something

--=20
Jaime Casanova=A0 =A0 =A0 =A0=A0 www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitaci=F3n

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #6258: Lock Sequence
Next
From: "Stan S"
Date:
Subject: BUG #6259: Collation Error with Citext fields