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

From Martin Kalcher
Subject Re: [PATCH] Introduce array_shuffle() and array_sample()
Date
Msg-id 459f6008-90bc-bc52-6f11-e68570e03ac0@aboutsource.net
Whole thread Raw
In response to Re: [PATCH] Introduce array_shuffle() and array_sample()  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: [PATCH] Introduce array_shuffle() and array_sample()
List pgsql-hackers
Am 21.07.22 um 14:25 schrieb Dean Rasheed:
> 
> I'm inclined to say that we want a new pg_global_prng_user_state that
> is updated by setseed(), and used by random(), array_shuffle(),
> array_sample(), and any other user-facing random functions we add
> later.
> 

I like the idea. How would you organize the code? I imagine some sort of 
user prng that is encapsulated in something like utils/adt/random.c and 
is guaranteed to always be seeded.

Martin



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: postgres_fdw: Fix bug in checking of return value of PQsendQuery().
Next
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH v1] eliminate duplicate code in table.c