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

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: [PATCH] Introduce array_shuffle() and array_sample()
Дата
Msg-id
3943591.1664374725@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() Fabien COELHO <coelho@cri.ensmp.fr>
Re: [PATCH] Introduce array_shuffle() and array_sample() Martin Kalcher <martin.kalcher@aboutsource.net>
Re: [PATCH] Introduce array_shuffle() and array_sample() Fabien COELHO <coelho@cri.ensmp.fr>
Re: [PATCH] Introduce array_shuffle() and array_sample() Martin Kalcher <martin.kalcher@aboutsource.net>
Re: [PATCH] Introduce array_shuffle() and array_sample() Martin Kalcher <martin.kalcher@aboutsource.net>
Re: [PATCH] Introduce array_shuffle() and array_sample() Andres Freund <andres@anarazel.de>
Re: [PATCH] Introduce array_shuffle() and array_sample() Martin Kalcher <martin.kalcher@aboutsource.net>
Re: [PATCH] Introduce array_shuffle() and array_sample() Tom Lane <tgl@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() Fabien COELHO <coelho@cri.ensmp.fr>
Re: [PATCH] Introduce array_shuffle() and array_sample() Tom Lane <tgl@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() Tom Lane <tgl@sss.pgh.pa.us>
Re: [PATCH] Introduce array_shuffle() and array_sample() Daniel Gustafsson <daniel@yesql.se>
Re: [PATCH] Introduce array_shuffle() and array_sample() Tom Lane <tgl@sss.pgh.pa.us>
Re: [PATCH] Introduce array_shuffle() and array_sample() Daniel Gustafsson <daniel@yesql.se>
Re: [PATCH] Introduce array_shuffle() and array_sample() Tom Lane <tgl@sss.pgh.pa.us>
Re: [PATCH] Introduce array_shuffle() and array_sample() Daniel Gustafsson <daniel@yesql.se>
Re: [PATCH] Introduce array_shuffle() and array_sample() Salek Talangi <salek.talangi@googlemail.com>
Re: [PATCH] Introduce array_shuffle() and array_sample() "Gregory Stark (as CFM)" <stark.cfm@gmail.com>
Re: [PATCH] Introduce array_shuffle() and array_sample() "Gregory Stark (as CFM)" <stark.cfm@gmail.com>
Fabien COELHO  writes:
>> Thanks for your thoughts, Tom. I have a couple of questions. Should we 
>> introduce a new seed function for the new PRNG state, used by array_shuffle() 
>> and array_sample()? What would be a good name? Or should those functions use 
>> pg_global_prng_state? Is it safe to assume, that pg_global_prng_state is 
>> seeded?

> I'd suggest to use the existing global state. The global state should be 
> seeded at the process start, AFAIKR.

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


В списке pgsql-hackers по дате отправления
От: Melih Mutlu
Дата:
От: Zhang Mingli
Дата:
FAQ