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 1gN99s-0004Gg-Ca for pgsql-committers@arkaria.postgresql.org; Thu, 15 Nov 2018 04:21:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gN99p-0007J0-O7 for pgsql-committers@arkaria.postgresql.org; Thu, 15 Nov 2018 04:21:33 +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 1gN99p-0007It-JF for pgsql-committers@lists.postgresql.org; Thu, 15 Nov 2018 04:21:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gN99n-0004Bn-Jk; Thu, 15 Nov 2018 04:21:33 +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 wAF4LRAC016660; Wed, 14 Nov 2018 23:21:27 -0500 From: Tom Lane To: Thomas Munro cc: Thomas Munro , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Increase the number of possible random seeds per time period. In-reply-to: References: <14712.1542253115@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Thu, 15 Nov 2018 16:59:15 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16658.1542255687.1@sss.pgh.pa.us> Date: Wed, 14 Nov 2018 23:21:27 -0500 Message-ID: <16659.1542255687@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Munro writes: > On Thu, Nov 15, 2018 at 4:38 PM Tom Lane wrote: >> Um, this bit is *not* right: > Will this close the case? > - srandom(((unsigned int) MyProcPid) ^ > - ((unsigned int) MyStartTimestamp << 12) ^ > - ((unsigned int) MyStartTimestamp >> 20)); > + srandom(((uint64) MyProcPid) ^ > + ((uint64) MyStartTimestamp << 12) ^ > + ((uint64) MyStartTimestamp >> 20)); WFM. regards, tom lane