Re: [PATCH] Introduce array_shuffle() and array_sample() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Introduce array_shuffle() and array_sample()
Date
Msg-id 3502301.1664223385@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Introduce array_shuffle() and array_sample()  (Martin Kalcher <martin.kalcher@aboutsource.net>)
Responses Re: [PATCH] Introduce array_shuffle() and array_sample()
List pgsql-hackers
Martin Kalcher <martin.kalcher@aboutsource.net> writes:
> [ v4-0001-Introduce-array_shuffle-and-array_sample.patch ]

I think this idea of exporting drandom()'s PRNG for all and sundry
to use is completely misguided.  If we go down that path we'll
be right back in the swamp that we were in when we used random(3),
namely that (a) it's not clear what affects what, and (b) to the
extent that there are such interferences, it could be bad, maybe
even a security problem.  We very intentionally decoupled drandom()
from the rest of the world at commit 6645ad6bd, and I'm not ready
to unlearn that lesson.

With our current PRNG infrastructure it doesn't cost much to have
a separate PRNG for every purpose.  I don't object to having
array_shuffle() and array_sample() share one PRNG, but I don't
think it should go much further than that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: identifying the backend that owns a temporary schema
Next
From: Robert Haas
Date:
Subject: Re: has_privs_of_role vs. is_member_of_role, redux