Re: pgsql: Increase the number of possible random seeds per time period.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Thomas Munro <tmunro(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Increase the number of possible random seeds per time period.
Date: 2018-11-15 04:21:27
Message-ID: 16659.1542255687@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> writes:
> On Thu, Nov 15, 2018 at 4:38 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Thomas Munro 2018-11-15 04:39:28 pgsql: Further adjustment to random() seed initialization.
Previous Message Thomas Munro 2018-11-15 03:59:15 Re: pgsql: Increase the number of possible random seeds per time period.