Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VeV4c-0004Ql-T9 for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Nov 2013 19:16:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VeV4c-0004sM-BF for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Nov 2013 19:16:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VeV4b-0004s1-EC for pgsql-bugs@postgresql.org; Thu, 07 Nov 2013 19:16:57 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VeV4Y-00067Q-1P for pgsql-bugs@postgresql.org; Thu, 07 Nov 2013 19:16:56 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VeV4V-0005xR-OR for pgsql-bugs@postgresql.org; Thu, 07 Nov 2013 11:16:51 -0800 Date: Thu, 7 Nov 2013 11:16:51 -0800 (PST) From: David Johnston To: pgsql-bugs@postgresql.org Message-ID: <1383851811735-5777396.post@n5.nabble.com> In-Reply-To: <527BE237.6040701@hogranch.com> References: <6157.1383849678@sss.pgh.pa.us> <527BE237.6040701@hogranch.com> Subject: Re: BUG #8582: field serial getted incorrect value from automaticaly created its sequence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: 1.8 (+) 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 John R Pierce wrote > On 11/7/2013 10:41 AM, Tom Lane wrote: >>=20 > evgeniy.skomorokhov@ > writes: >>> >Automaticaly created sequence takes values =C3=A2=E2=82=AC=E2=80=B9=C3= =A2=E2=82=AC=E2=80=B9from the range [1; >>> >9223372036854775807] but max value of field which will be filled from >>> >sequence - max of type integer (2147483647). >> If you want a bigint column, use "bigserial". Not everybody wants >> to take that space penalty, though. >=20 >=20 > I think he's suggesting that a sequence generated from a regular serial=20 > probably shouldn't have that 63 bit max_value The main advantage of the current behavior is if you hit the limit for an integer you can alter the column type to bigint without having to mess around with the associated sequence. If the sequence was upper-bound limited that same conditions that caused the out-of-range error will just generate a different kind of error (not sure which one if the sequence is exhausted). Its definitely not a "bug" whether you believe the behavior should be changed or not. A sequence is de-coupled from any particular type. Maybe if there were short, normal, and big sequences with matching performance improvements it would matter but having only a single sequence implementation makes the current behavior/defaults reasonable for normal usage. I am curious why this even came up. This seems to be the kind of thing most people would be oblivious to. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-8= 582-field-serial-getted-incorrect-value-from-automaticaly-created-its-seque= nce-tp5777360p5777396.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs