Maybe a bug found with nextval() function - Mailing list pgsql-bugs

From Alexander Troppmann
Subject Maybe a bug found with nextval() function
Date
Msg-id 200402191916.46489.talex@cocktaildreams.de
Whole thread Raw
Responses Re: Maybe a bug found with nextval() function
Re: Maybe a bug found with nextval() function
List pgsql-bugs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
                        POSTGRESQL BUG REPORT TEMPLATE
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D

Your name           : Alexander Troppmann
Your email address  : talex@cocktaildreams.de


System Configuration
--------------------
Architecture        : AMD Duron
Operating System    : Fedora Core 1.A (Linux 2.4.22-1.2174.nptl)
PostgreSQL version  : PostgreSQL-7.3.4
Compiler used       : gcc-3.3.2


Please enter a FULL description of your problem:
------------------------------------------------


The nextval() function returns instead of the next valid integer value in t=
he
corresponding SEQUENCE a whole range of exactly 435 values with each functi=
on
call... The sequence and tables have been migrated from a previous PostgreS=
QL
version - newer created tables and sequences work fine!




Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------


My database has been migrated from previous versions of PostgreSQL. One tab=
le
is called "recipe" and has a column "id" of type SERIAL as primary key:

 Column  | Type      |             Modifiers
---------+-----------+----------------------------------------------------
 id      | integer   | not null default nextval('"recipe_id_seq"'::text)

I din't use the features from a SERIAL type on this table before but at the
moment I'm working on a complete new database frontend.... So first I tried
to update the value of the "recipe_id_seq" SEQUENCE appropriate to the
latest recipe.id value:

   SELECT SETVAL('recipe_id_seq', max(id)) FROM recipe;

returns the following output:

    setval
   --------
       455
   (1 row)

Now I tried to fetch the next free primary key id for my "recipe" table:

   SELECT NEXTVAL('recipe_id_seq') FROM receipt;

I just wonder because the NEXTVAL query returns after every call exactly
435 rows of increasing integer values...?! Also I tested some other tables
with a SERIAL primary key and the same result - instead of the next valid
integer value I get a whole range of values, 435 times...

A table created with a PostgreSQL 7.3.x version works fine - the SEQUENCE
returns exactly (the next valid) integer value - so maybe the migrated table
structures/data from my previous PostgreSQL installations cause the trouble=
s?

I already tried to fix the problem by dropping the "recipe_id_seq" and=20
creating a new one - with any success... :-(



best regards,
Alex Troppmann

pgsql-bugs by date:

Previous
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1081: Spelling error in tsearch2.sql leading to problems with tsearch
Next
From: "siva"
Date:
Subject: i have one doubt