Skip site navigation (1) Skip section navigation (2)

Bug in CREATE SEQUENCE x MAXVAL x parsing?

From: Metalstorm <metlstrm(at)ihug(dot)co(dot)nz>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug in CREATE SEQUENCE x MAXVAL x parsing?
Date: 1999-12-01 02:39:56
Message-ID: 38448A7C.24C473FB@ihug.co.nz (view raw or flat)
Thread:
Lists: pgsql-bugs
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               :       Adam Boileau
Your email address      :       metlstrm(at)ihug(dot)co(dot)nz


System Configuration
---------------------
  Architecture (example: Intel Pentium)         :   Dual Intel P2

  Operating System (example: Linux 2.0.26 ELF)  :   Linux 2.2.10

  PostgreSQL version (example: PostgreSQL-6.5.3):   PostgreSQL-6.5.3 

  Compiler used (example:  gcc 2.8.0)           :   gcc 2.95.1


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

Creating a sequence whose maxvalue is > signed-4-byte-int-max generates
a parse error.
Inserting the same value into an int8 field works, however. 
Conclusion: create sequence doesnt parse > int4, but insert does.



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

euclid=> create table test (Im_big int8);
CREATE

--Insert int4-max + 1
euclid=> insert into test values (2147483648);
INSERT 192329 1

--Create a sequence whose maxval is int4-max
euclid=> create sequence im_big_seq maxvalue 2147483647;
CREATE

--Hmm, works great.
euclid=> drop sequence im_big_seq;    
DROP

--Create a sequence whose maxval is int4-max + 1
euclid=> create sequence im_big_seq maxvalue 2147483648;
ERROR:  parser: parse error at or near "2147483648"
ERROR:  parser: parse error at or near "2147483648"

--No sir, I dont like it.

pgsql-bugs by date

Next:From: postgresDate: 1999-12-01 03:18:59
Subject: Bug in Create sequence parsing?
Previous:From: Tatsuo IshiiDate: 1999-11-30 04:43:27
Subject: Re: [HACKERS] Problems in 6.5.3 with Multi-Byte encoding

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group