Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id CA0C61C0B196 for ; Fri, 20 Jul 2012 05:19:19 -0300 (ADT) Received: from 7.mo3.mail-out.ovh.net ([46.105.57.200] helo=mo3.mail-out.ovh.net) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ss8Qd-0000nu-SP for pgsql-bugs@postgresql.org; Fri, 20 Jul 2012 08:19:18 +0000 Received: from mail412.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo3.mail-out.ovh.net (Postfix) with SMTP id 7DAEAFF8E0A for ; Fri, 20 Jul 2012 10:24:32 +0200 (CEST) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 20 Jul 2012 10:19:02 +0200 Received: from 138.4.14.109.rev.sfr.net (HELO MacBook-Pro-de-Harsh-Singhal.local) (harsh.singhal@cy-play.com@109.14.4.138) by ns0.ovh.net with SMTP; 20 Jul 2012 10:19:01 +0200 Message-ID: <50091474.6030908@cy-play.com> Date: Fri, 20 Jul 2012 10:19:00 +0200 From: SINGHAL Harsh User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120717 Thunderbird/15.0 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org X-Ovh-Mailout: 178.32.228.3 (mo3.mail-out.ovh.net) Subject: Sequence id NOT incremented as expected Content-Type: multipart/alternative; boundary="------------060001080301060404020201" X-Ovh-Tracer-Id: 1474084453058516656 X-Ovh-Remote: 109.14.4.138 (138.4.14.109.rev.sfr.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: 0 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeegkedrkeegucetufdoteggodetrfdofgetucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenucenucfhrhhomhepuffkpffijfetnfcujfgrrhhshhcuoehhrghrshhhrdhsihhnghhhrghlsegthidqphhlrgihrdgtohhmqeenucfjughrpefkfffhfgggvffutgesrgdtrggrtdefud X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeegkedrkeegucetufdoteggodetrfdofgetucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenucenucfhrhhomhepuffkpffijfetnfcujfgrrhhshhcuoehhrghrshhhrdhsihhnghhhrghlsegthidqphhlrgihrdgtohhmqeenucfjughrpefkfffhfgggvffutgesrgdtrggrtdefud X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/175 X-Sequence-Number: 33651 This is a multi-part message in MIME format. --------------060001080301060404020201 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit FACTS : 1. Sequences are based on bigint arithmetic, so the range cannot exceed the range of an eight-byte integer (-9223372036854775808 to 9223372036854775807). On some older platforms, there may be no compiler support for eight-byte integers, in which case sequences use regular integer arithmetic (range -2147483648 to +2147483647). 2. The CYCLE option allows the sequence to wrap around when the maxvalue or minvalue has been reached by an ascending or descending sequence respectively. If the limit is reached, the next number generated will be the minvalue or maxvalue, respectively. Reality : * version PostgreSQL 8.4.12 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 64-bit * Colonne|Type|Valeur sequence_name|name|xxx_id_seq last_value|bigint|1 start_value|bigint|1 increment_by|bigint|1 max_value|bigint|9223372036854775807 min_value|bigint|1 cache_value|bigint|1 log_cnt|bigint|32 is_cycled|boolean|t is_called|boolean|t * In an increasing sequence whose max value is set to 9223372036854775807 and cycle option is activated, as shown above, from 2147483647 to 9223372036854775807 it is displaying error "ERREUR: entier en dehors des limites" and after that it resets it to 1 which is normal for any sequence whose cycle option is activated. * Can you please tell what to do during the interval (2147483647 to 9223372036854775807) or How to restart the sequence at 2147483647 ? -- -- Harsh Raj SINGHAL Cy-Play --------------060001080301060404020201 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit FACTS :
  1. Sequences are based on bigint arithmetic, so the range cannot exceed the range of an eight-byte integer (-9223372036854775808 to 9223372036854775807). On some older platforms, there may be no compiler support for eight-byte integers, in which case sequences use regular integer arithmetic (range -2147483648 to +2147483647).
  2. The CYCLE option allows the sequence to wrap around when the maxvalue or minvalue has been reached by an ascending or descending sequence respectively. If the limit is reached, the next number generated will be the minvalue or maxvalue, respectively.

Reality :

  • version
    PostgreSQL 8.4.12 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 64-bit
  • Colonne|Type|Valeur
    sequence_name|name|xxx_id_seq
    last_value|bigint|1
    start_value|bigint|1
    increment_by|bigint|1
    max_value|bigint|9223372036854775807
    min_value|bigint|1
    cache_value|bigint|1
    log_cnt|bigint|32
    is_cycled|boolean|t
    is_called|boolean|t
  • In an increasing sequence whose max value is set to 9223372036854775807 and cycle option is activated, as shown above, from 2147483647 to 9223372036854775807 it is displaying error "ERREUR:  entier en dehors des limites" and after that it resets it to 1 which is normal for any sequence whose cycle option is activated.
  • Can you please tell what to do during the interval (2147483647 to 9223372036854775807) or How to restart the sequence at 2147483647 ?
-- 
--
Harsh Raj SINGHAL
Cy-Play
--------------060001080301060404020201--