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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Increase the number of possible random seeds per time period.
Дата
Msg-id 16659.1542255687@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Increase the number of possible random seeds per time period.  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-committers
Thomas Munro <thomas.munro@enterprisedb.com> writes:
> On Thu, Nov 15, 2018 at 4:38 PM Tom Lane <tgl@sss.pgh.pa.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


В списке pgsql-committers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: pgsql: Increase the number of possible random seeds per time period.
Следующее
От: Thomas Munro
Дата:
Сообщение: pgsql: Further adjustment to random() seed initialization.