Re: random() function documentation

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: random() function documentation
Date: 2022-04-11 19:00:26
Message-ID: 8735ijphrp.fsf@wibble.ilmari.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= <ilmari(at)ilmari(dot)org> writes:
>> I just noticed that the since the random() rewrite¹, the documentation's
>> claim² that it "uses a simple linear congruential algorithm" is no
>> longer accurate (xoroshiro128** is an xorshift variant, which is a
>> linear-feedback shift register algorithm).
>
>> I don't have a suggestion for the exact wording, since I don't know
>> whether xoroshiro128** qualifies as "simple", or to what level of
>> specificity we want to document the algorithm.
>
> How about we just say "uses a linear-feedback shift register algorithm"?

That works for me. Nice and simple, and not overly specific. Should we
perhaps also add a warning that the same seed is not guaranteed to
produce the same sequence across different (major?) versions?

> "Simple" is in the eye of the beholder anyway.

Indeed.

> regards, tom lane

- ilmari

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-04-11 19:12:35 Re: How about a psql backslash command to show GUCs?
Previous Message Thom Brown 2022-04-11 18:51:03 Re: [COMMITTERS] pgsql: Allow time delayed standbys and recovery