Re: [PATCH] Introduce array_shuffle() and array_sample()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Introduce array_shuffle() and array_sample()
Дата
Msg-id 3502301.1664223385@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Introduce array_shuffle() and array_sample()  (Martin Kalcher <martin.kalcher@aboutsource.net>)
Ответы Re: [PATCH] Introduce array_shuffle() and array_sample()
Список 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 по дате отправления:

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: identifying the backend that owns a temporary schema
Следующее
От: Robert Haas
Дата:
Сообщение: Re: has_privs_of_role vs. is_member_of_role, redux