Re: random() function documentation
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-04-12T15:03:41Z
Lists: pgsql-hackers
Fabien COELHO <coelho@cri.ensmp.fr> writes: >>> 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. > Hmmm… I'm not so sure. ISTM that people interested in using the random > user-facing variants (only random?) could like a pointer on the algorithm > to check for the expected quality of the produced pseudo-random stream? > See attached. I don't want to get that specific. We were not specific before and there has been no call for such detail in the docs. (Unlike closed-source software, anybody who really wants algorithmic details can find all they want to know in the source code.) It would just amount to another thing to forget to update next time someone changes the algorithm ... which is a consideration that leads me to favor Dean's phrasing. regards, tom lane
Commits
-
Doc: update description of random() function.
- d4f109e4a2c0 15.0 landed
-
Replace random(), pg_erand48(), etc with a better PRNG API and algorithm.
- 3804539e48e7 15.0 cited