Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jA1Ar-0007Jm-OT for pgsql-committers@arkaria.postgresql.org; Fri, 06 Mar 2020 00:49:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jA1Aq-00084T-HM for pgsql-committers@arkaria.postgresql.org; Fri, 06 Mar 2020 00:49:08 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1jA1Aq-00084M-9o for pgsql-committers@lists.postgresql.org; Fri, 06 Mar 2020 00:49:08 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jA1Ao-0005uC-3J for pgsql-committers@lists.postgresql.org; Fri, 06 Mar 2020 00:49:07 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C75112229C; Thu, 5 Mar 2020 19:49:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 05 Mar 2020 19:49:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=M7OxvK+e1IZlFczU/dcbnn2zsNQ C0ySLjc9nqt1fXBE=; b=X2JvV674XQijAqQeJwfOEJd6z80YBvBEIrnsLJvuYW+ QqCfTe1/yS0vCrc58/hvpfYyURJYQrVBbu+ZydwHg5WeHlB147kDdRt1zG5yxaMZ 1vGZeTixY/rd/70KL0R8imFWQR9BwXMTcAEVi5k2jtSHqFWF85Ph1oAHmqPywhqx zKniLyOGOsvoa5ih75PZkZ2gREMnFudsvzEMeseUCoz8psz/A8X6Yxum6P329dqf 4L2+XRL19FA1MrfH+jyqyOQygZbq2UDrp+2vy9UJpDRkQpcgCSrd3m3zgOktLj+F xhZvOq7sHIOZaCy+8wpqysmrLs8KbbZmYbYAVJrixCQ== 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-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=M7OxvK +e1IZlFczU/dcbnn2zsNQC0ySLjc9nqt1fXBE=; b=EIwlZzSl9TZGMDde8YuQCc BVz/sUT6fGjEEyNTwn6wks2r2Cq6TilyYnsAweL2ZkYX7AD0nY6inYbYCn0MdXB0 2V6KeZLSo2c5aLVp5xFNIvVTEkfJ5EOymtfojoJqFKcYtBR4K8qU64CotUBq//Gf DDEoKNIqyVgXvRv4JXVrw2YWoxFK/oDgU4Nv1sZo5ytiHC28Cr0NW66slAPbuG78 /Cjx33i86G4Yodyao+Lw1JwSaBz7OIU7CQbCiPZneZpMPtjy1oBj+Cd280HlsXFo x3vFj9kd5ERUgC1AlTix9a2HIa7zhG2gKd5hcHVXZyfTo+kPctDXyxpwBY/D+dDw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudduuddgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepuddukedrvdeguddrvdehtddruddvnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesph grqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (mp76f1fa0c.ap.nuro.jp [118.241.250.12]) by mail.messagingengine.com (Postfix) with ESMTPA id C81783280064; Thu, 5 Mar 2020 19:49:02 -0500 (EST) Date: Fri, 6 Mar 2020 09:48:58 +0900 From: Michael Paquier To: Magnus Hagander Cc: David Steele , pgsql-committers Subject: Re: pgsql: Avoid -Wconversion warnings when using checksum_impl.h Message-ID: <20200306004826.GB52814@paquier.xyz> References: <1cf30561-7dad-dc6e-9fc3-5c456948cfeb@pgmasters.net> <20200305233014.GA2501@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lMM8JwqTlfDpEaS6" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --lMM8JwqTlfDpEaS6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Mar 05, 2020 at 04:14:20PM -0800, Magnus Hagander wrote: > That's a pretty dangerous mistake, and moreso because we don't have a > test around it. We should really find a way to add such a test -- just > a hardcoded page calculation that should always return the same value > perhaps? Yes.. Using pg_checksums --check on an upgraded instance which had checksums enabled would detect that immediately, but it could be possible also to have a SQL-callable function which takes in input a bytea and returns the checksum. In order to make such tests reliable with any page size, we could pass down the page size to pg_checksum_page(), and then give the function's caller this possibility. However I recall that we'd rather keep BLCKSZ hardcoded in checksum_impl.h on performance grounds. -- Michael --lMM8JwqTlfDpEaS6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl5hnfoACgkQnvQgOdby QH1uhhAApX3Wm1mJX0kreWSOmu4w0hcG8aQjIzh7IUDTi1BShVIRA52dXNi/8bal rf3bDM58JcjyvaWHL8ZlOobJ+feDERt3gNu3zzD1EOjlGWdI+rK4OxSnjDDDLSWC J/uPCsg0bx9g6dcXmHnhMB4Op9+TTeIDota0cv7iCqbS/mJVJjRLpeIjW9QI0Odo PSi0mctkEHoHOQPe73lFfN2A3F41wpCu9HBxGVNQqhkGdaptyv+wEuaLMgfCHVag +ezt7hAVq0Q0CvEfsQUaaJphb9aI8Db4kBGU+Qi6s6d38LTosxHNwnAll5WSwn/I 8P9lgCo64wJ1O9j9POUbNXSA1AU4qyovVAoaYHCKbwdjSmGYNViPqsZzCajuVJf8 +Hm5hI/+lbni1AXCm+/+TITMMlLkeKbuMkjg9Nnru6tjtCJg1JpYNq6eKBYLFeC1 0oGM4q6yYN+G3Wf3t2BGCh4B3mhwkZqUWBytYTGKFKcYq5Heff39+eb8fYli+Fzo KfKH2nmBTocDBdqOIp0Jhd40rV6SlrTsWc5MlitLxh05qvBKsVMimKmBeYnlcz8R VutHydAD0RHj4cQbxulgqJcEpP1Fj1AVNTNJALXI66SflkR6i+Idk00yK2T280LB 7oH5zfBi7a2AR7QJRiqLt5GcRhHsMCm+KbZyAfZAvg6PBvDFZ3M= =WcIA -----END PGP SIGNATURE----- --lMM8JwqTlfDpEaS6--