Re: random() function documentation

Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>

From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-04-12T15:12:06Z
Lists: pgsql-hackers
Dean Rasheed <dean.a.rasheed@gmail.com> writes:

> On Mon, 11 Apr 2022 at 20:20, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> >> How about we just say "uses a linear-feedback shift register algorithm"?
>
> I think it'd be sufficient to just say that it's a deterministic
> pseudorandom number generator. I don't see much value in documenting
> the internal algorithm used.
>
>> > Should we
>> > perhaps also add a warning that the same seed is not guaranteed to
>> > produce the same sequence across different (major?) versions?
>>
>> I wouldn't bother, on the grounds that then we'd need such disclaimers
>> in a whole lot of places.  Others might see it differently though.
>
> Agreed, though I think when the release notes are written, they ought
> to warn that the sequence will change with this release.

WFM on both points.

> Regards,
> Dean

- ilmari



Commits

  1. Doc: update description of random() function.

  2. Replace random(), pg_erand48(), etc with a better PRNG API and algorithm.