Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1etqby-0000RO-TI for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Mar 2018 08:09:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1etqbx-0008Gq-7K for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Mar 2018 08:09:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1etqbw-0008Gh-KP for pgsql-bugs@lists.postgresql.org; Thu, 08 Mar 2018 08:09:13 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1etqbt-0008Cp-1R for pgsql-bugs@lists.postgresql.org; Thu, 08 Mar 2018 08:09:11 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 31D1DC2A; Thu, 8 Mar 2018 03:09:07 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Thu, 08 Mar 2018 03:09:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=4OU5R7Q4RxbJ6CVmR3TCAneS+ypn/dBp5Nhidlfjr8w=; b=b7U/6umA Vlvy5gSlMNev6CHC/xNoAU1OMVWzFIb/3/zHkS4kfad8knrKfVK3p/BWD6Zsz3r7 55wSadRYWR4xsaevrCTTUvmjlHltL8OsLVFNsfSxaLGCmH7Jf/q8kaUw6Bi17S4K LFljeWYlFdUCzAVbL3yCSl6qDoNTVAiSiC88kSAU9WqwIGobd7PNZznHzkBaRSBL aANJkezp+RjWRcUKRajvFhL7O9UU1YclkYCeAKZgdbfgymv+Iz5fKhmnQgj1/R4I bZdwh8J1X0njbWhdX3YnQaEYqy2nwlzlbNFodnaHqKCI8oHv8AEa2TvFgBVIuVIh /z3F8F3UexIyqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=4OU5R7Q4RxbJ6CVmR3TCAneS+ypn/ dBp5Nhidlfjr8w=; b=RD9ogW1PdD/oV13txsdVQk28P/zRW7C4UeJkUmXaGUk5c Q8Rv3+S+FEkI22nz2rT3RWMznZBBJK5n3s4St0xaXt6bxW0TKN+EJ3qQU6ZBulv6 hJcBlOXwO1LQBKB39wdJeeCFpnsckk723lZJTblSX4F1bWD9EB7tIsNQsFdCx1ex D4jjI7ziHzsW3EyNcIKgLiC9PqtB3cSpM5wJ7daKavD+dLMgcPbr9nayHtvvVkOS rikg1fY1ntdmE/jxoZlgxP0b11vb32JXNYMnCTdWOD1VgjeFbTEVjclWt09sfdcA jYRpWCWnTw83ck0dibMsA7EDdM6Tc1VvMI3dF/NUg== X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 4224324519; Thu, 8 Mar 2018 03:09:02 -0500 (EST) Date: Thu, 8 Mar 2018 17:08:58 +0900 From: Michael Paquier To: Peter Eisentraut Cc: Tom Lane , Andrew Gierth , evgeni-klimov@yandex.ru, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15096: Unable to CREATE TABLE LIKE with bigint identity column Message-ID: <20180308080858.GE1788@paquier.xyz> References: <152009601619.21242.262498029671910378@wrigleys.postgresql.org> <31194.1520098424@sss.pgh.pa.us> <87po4lkkaj.fsf@news-spur.riddles.org.uk> <20180304235654.GA32165@paquier.xyz> <87lgf7l6sj.fsf@news-spur.riddles.org.uk> <21016.1520228672@sss.pgh.pa.us> <20180305061325.GF2266@paquier.xyz> <26456.1520278713@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yH1ZJFh+qWm+VodA" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --yH1ZJFh+qWm+VodA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 07, 2018 at 03:16:44PM -0500, Peter Eisentraut wrote: > Here is a patch that fixes this bug, and a second patch (not for > backpatching) that changes the Value node to use int instead of long. Thanks Peter for diving in. Patch 1 looks fine to me. Here are some comments for patch 2. + if (endptr !=3D token + length || errno =3D=3D ERANGE || + /* check for overflow of int4 */ + val !=3D (long) ((int32) val)) return T_Float; It would be nice to have this check be consistent with the new definition of ival and int32, One suggestion is to use directly int32 or just have a static assertion that sizeof(int) =3D=3D sizeof(int32)? Or that's too much nannyism? By the way, why do you remove HAVE_LONG_INT_64? On platforms where long is 4 bytes this would still be a no-op. If you care about those, you could also remove the ones in interval.c and datetime.c... The comment block on top of the definition of Value in value.h still mentions "long", while it should mention "int" per your patch. =20 -- Michael --yH1ZJFh+qWm+VodA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlqg75oACgkQnvQgOdby QH0Btw//fD+Lj4NdFzvthioJwmvZ8rEcd1rwYFekLYJ5i1lmNWgDAJAy6/pNdtiZ nRnAJXb7Gk4SY26AlEcgrPP0673Y3a9VTQ468JqsbXozsCJBrcFW7l/Xs3e1lCPe 68KJglk6sKYIVfrlCniCLm+GsqkW85wLqrXYiH/8I8GtQzWDbYUYBh/FBIzcUQZt TAUgZtkoyRjBZlz3sKS+5/Y/i3OkhuLW03hYpahNPg9V6MPUmDi9B8Gat2DFBr0w fAHucjMIqGjpEV4SlM+fcPgQdqhabZCFU1ylliVoq1i2BC8dJHK/PhZzjNZWmS/F +beEt2jcvY1hgLnieovLdM8xqDOKMRMzJVSTCuNfc2ludLoBfy2YJOX6NGvRQvuu VfsyzCBQUdJNhDzgMIFoXH+R0ayzhGIunEe4UK1HQuBWYNZVia88YwbkOhOiTON9 fWSRLs2B0ABNI6+0gRC2hUWjU+egkqQ7yUPAzGfPaRiZFy6RVIARwjlIqzrzcVZF MrVKxnVA4Sg8/F8oWpYaf3F1IMbgc/o4lozAwfsVqjy/GRCTWZQWkJxKpaStN4yn aD9cA8iO50e2kh7AjgoUeR0NhoZKrO6XPtVetANOg4sNMooQtcuidtqY6ow/NduD 9qKslpDlVVgGn1h1YlH1aBynGdQCil8A2HiTpAqVqlULqxiNnyE= =PCuy -----END PGP SIGNATURE----- --yH1ZJFh+qWm+VodA--