Re: [SQL] abusing an aggregate funct

From: Postgres DBA <postgres(at)nest(dot)bistbn(dot)com>
To: M Simms <grim(at)argh(dot)demon(dot)co(dot)uk>
Cc: SQL Mailing List <pgsql-sql(at)postgreSQL(dot)org>
Subject: Re: [SQL] abusing an aggregate funct
Date: 1998-11-15 14:46:17
Message-ID: Pine.BSF.4.02.9811151643140.12790-100000@nest.bistbn.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Sun, 15 Nov 1998, M Simms wrote:

> > Unfortunately, solution using sequences is not so good unless you don't
> > suppose to use access to that table from some simultaneously running
> > sessions. The problem is that every sessions accessing this additional
> > sequence with nextval() will get its own pool of values for the
> > sequence, so early or later you'll get some gaps in records numbering
> > because of at least on of two reasons:
>
> >From the manpage of create sequence
>
>
> Low-level locking is used to enable multiple simultaneous
> calls to a generator.
>
> Doesnt this mean it will work for this task?
>
>

Sure, you can access one sequence from a couple of sessions at once but
it the only thing is guaranteed is UNIQUENESS of values you get from
nestval() across one sequence. Although nobody can promise you that there
will no gaps... There are lots of reasons, I mentioned just some of them
(see my previous posting in this thread)

Aleksey

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1998-11-15 15:02:55 Re: [SQL] Incrimenting question
Previous Message Postgres DBA 1998-11-15 14:04:08 Re: [SQL] abusing an aggregate funct