Re: BUG #2380: Sequence problem

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Alex Fomin <google(at)gmx-topmail(dot)de>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2380: Sequence problem
Date: 2006-04-07 02:43:00
Message-ID: 20060407024300.GA55704@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Apr 06, 2006 at 10:04:03AM +0000, Alex Fomin wrote:
> While using the following function:
> ---
> nextval(sequence_name) returns currval(sequence_name) -1
> ---
> while +1 is expected. It happens only sometimes, no dependency can be found.

Could you provide a complete test case? That is, all SQL statements
that somebody could execute in an empty database to reproduce the
problem. It doesn't have to be 100% reproducible as long as it
does exhibit the behavior every once in a while (an indication of
how often or under what circumstances, if known, would be helpful).

Is it possible that another session is altering the sequence to
start with a lower value? Have you perchance set the sequence's
CACHE setting to a value other than 1 (one)? What's the output of
"SELECT * FROM sequence_name"? Are you making queries from more
than one session? Are you using connection pooling?

--
Michael Fuhr

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2006-04-07 03:37:26 Re: BUG #2376: permission roles not respected
Previous Message Philip Warner 2006-04-07 01:56:37 Re: BUG #2379: Duplicate pkeys in table