From d4f109e4a2c028bcd889cc44d84b10fff7d9186b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 12 Apr 2022 11:36:45 -0400 Subject: [PATCH] Doc: update description of random() function. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/875ynfpiru.fsf@wibble.ilmari.org --- doc/src/sgml/func.sgml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 0a5c402640d..93ba39eff10 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1832,8 +1832,9 @@ repeat('Pg', 4) PgPgPgPg - The random() function uses a simple linear - congruential algorithm. It is fast but not suitable for cryptographic + The random() function uses a deterministic + pseudo-random number generator. + It is fast but not suitable for cryptographic applications; see the module for a more secure alternative. If setseed() is called, the series of results of