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.89) (envelope-from ) id 1if7Y2-0004J2-1z for pgsql-general@arkaria.postgresql.org; Wed, 11 Dec 2019 19:21:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1if7X2-0000Vx-T4 for pgsql-general@arkaria.postgresql.org; Wed, 11 Dec 2019 19:20:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1if7X2-0000Vp-FP for pgsql-general@lists.postgresql.org; Wed, 11 Dec 2019 19:20:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1if7Wx-0006Fz-T2 for pgsql-general@postgresql.org; Wed, 11 Dec 2019 19:20:18 +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 xBBJKAY4024651; Wed, 11 Dec 2019 14:20:11 -0500 From: Tom Lane To: Erwin Brandstetter cc: Laurenz Albe , pgsql-general@postgresql.org Subject: Re: Fast, stable, portable hash function producing 4-byte or 8-byte values? In-reply-to: References: <67fe6aff570841a0fab4c7b9f5c316b5d54f88c3.camel@cybertec.at> Comments: In-reply-to Erwin Brandstetter message dated "Wed, 11 Dec 2019 19:01:43 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <24649.1576092010.1@sss.pgh.pa.us> Date: Wed, 11 Dec 2019 14:20:10 -0500 Message-ID: <24650.1576092010@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Erwin Brandstetter writes: > Guess Tom's warning in > https://www.postgresql.org/message-id/9434.1568839177@sss.pgh.pa.us about > portability only refers to hashtextextended() and friends not being there > in Postgres 10 or older. Well, the other portability issue that is worth considering is that these functions are only intended to give stable results within a particular installation; their use for hash indexes does not require the same results across different platforms. Notably, most of them give different answers on little-endian and big-endian machines. That's not necessarily a reason not to use them, but you have to be careful what you assume about them. regards, tom lane