Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WIuzZ-00081A-JW for pgsql-bugs@arkaria.postgresql.org; Thu, 27 Feb 2014 07:02:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WIuzZ-0004w7-2u for pgsql-bugs@arkaria.postgresql.org; Thu, 27 Feb 2014 07:02:49 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WIuzY-0004w0-2R for pgsql-bugs@postgresql.org; Thu, 27 Feb 2014 07:02:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WIuzV-0006ji-Ih for pgsql-bugs@postgresql.org; Thu, 27 Feb 2014 07:02:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s1R72hsg019375; Thu, 27 Feb 2014 02:02:43 -0500 From: Tom Lane To: kashi@fhpg.net cc: pgsql-bugs@postgresql.org Subject: Re: BUG #9366: Default MAXVALUE is incorrect for sequence object of serial type In-reply-to: <20140227034510.26578.68200@wrigleys.postgresql.org> References: <20140227034510.26578.68200@wrigleys.postgresql.org> Comments: In-reply-to kashi@fhpg.net message dated "Thu, 27 Feb 2014 03:45:10 +0000" Date: Thu, 27 Feb 2014 02:02:43 -0500 Message-ID: <19374.1393484563@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org kashi@fhpg.net writes: > When I create the new table as serial type column , I found a strange > condition on sequence parameter. > It could be specified as integer, but MAXVALUE of sequence is set as > Bigint. This is not a bug, but intentional behavior. See http://www.postgresql.org/message-id/flat/E1VeK8A-0006V4-EX@wrigleys.postgresql.org#E1VeK8A-0006V4-EX@wrigleys.postgresql.org > At that case, MAXVALUE of test_int_seq_int_seq is "9223372036854775807". As > the result, if the current value is 2147483647, next insert operation could > be failed as "ERROR: integer out of range". So? If we set the sequence limit differently, the case would still fail, just with a different error message. And you'd then have two things to fix, not only one, to get your database back in working order. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs