Doc: update description of random() function.
authorTom Lane <[email protected]>
Tue, 12 Apr 2022 15:36:45 +0000 (11:36 -0400)
committerTom Lane <[email protected]>
Tue, 12 Apr 2022 15:36:45 +0000 (11:36 -0400)
Commit 3804539e4 neglected to update the documentation's claim that
random() uses a "linear congruential algorithm".  In hopes of avoiding
the same mistake if someone replaces our PRNG again, just say it's a
deterministic pseudo-random number generator and leave it at that.
Anybody who really wants to know can look in the source code.

COMPATIBILITY NOTE FOR RELEASE NOTES: 3804539e4's commit message
really should have mentioned that the random() sequence after
setseed(), while still repeatable, will differ from what you got
in pre-v15 releases.

Noted by Dagfinn Ilmari MannsÃ¥ker; wording suggestion by Dean Rasheed.

Discussion: https://postgr.es/m/[email protected]

doc/src/sgml/func.sgml

index 0a5c402640d19882d08a1782a36ce7cfdef2291c..93ba39eff10a2d2e5fd018b15d8fe28837ffbb32 100644 (file)
@@ -1832,8 +1832,9 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
    </table>
 
   <para>
-   The <function>random()</function> function uses a simple linear
-   congruential algorithm.  It is fast but not suitable for cryptographic
+   The <function>random()</function> function uses a deterministic
+   pseudo-random number generator.
+   It is fast but not suitable for cryptographic
    applications; see the <xref linkend="pgcrypto"/> module for a more
    secure alternative.
    If <function>setseed()</function> is called, the series of results of