sequence increment jumps?

From: "John Smith" <jayzee(dot)smith(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: sequence increment jumps?
Date: 2007-01-25 17:33:51
Message-ID: f029597e0701250933y2bd6a2ccq7bdef7e29cfce561@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

guys,
i inserted 1 record into my database (default
nextval('sequencename'::regclass) where (start 1 increment 1)). then i
tried to insert 1 other record twice but both those inserts failed
because of a domain check ("ERROR: value too long for type character
varying(X)". when i was finally able to insert that record the
sequence jumped 2 places. seems like it counted the failed inserts?

i had insert errors yesterday ("ERROR: invalid input syntax for
integer" "ERROR: column 'columnname' is of type date but expression is
of type integer") but they didn't cause any increment jumps. and when
i insert a record now the sequence increments just fine.

bug or nature of the beast? how to reset? btw using 8.1, got no other
sessions, no record deletes, no triggers, no rules.
jzs

http://www.postgresql.org/docs/8.1/interactive/sql-createsequence.html
http://archives.postgresql.org/pgsql-general/2001-11/msg01004.php
http://archives.postgresql.org/pgsql-admin/2002-02/msg00335.php

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-01-25 17:42:11 Re: Stats collector frozen?
Previous Message Jeremy Haile 2007-01-25 17:31:57 Re: Stats collector frozen?