Re: [PATCH] Introduce array_shuffle() and array_sample()
Martin Kalcher <martin.kalcher@aboutsource.net>
From: Martin Kalcher <martin.kalcher@aboutsource.net>
To: Tom Lane <tgl@sss.pgh.pa.us>, Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Andres Freund <andres@anarazel.de>,
Dean Rasheed <dean.a.rasheed@gmail.com>, Robert Haas
<robertmhaas@gmail.com>, Andrew Dunstan <andrew@dunslane.net>,
John Naylor <john.naylor@enterprisedb.com>,
Thomas Munro <thomas.munro@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-09-29T09:39:28Z
Lists: pgsql-hackers, pgsql-general
Attachments
- v5-0001-Introduce-array_shuffle-and-array_sample.patch (text/x-patch) patch v5-0001
Am 28.09.22 um 16:18 schrieb Tom Lane: > It is seeded at process start, yes. If you don't feel a need for > user control over the sequence used by these functions, then using > pg_global_prng_state is fine. (Basically the point to be made > here is that we need to keep a tight rein on what can be affected > by setseed().) > > regards, tom lane New patch: array_shuffle() and array_sample() use pg_global_prng_state now. Martin
Commits
-
Add array_sample() and array_shuffle() functions.
- 888f2ea0a81f 16.0 landed
-
Use a separate random seed for SQL random()/setseed() functions.
- 6645ad6bdd81 12.0 cited