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 fe7a6a81-5c1b-aaae-922f-cb86be324373@aboutsource.net
Whole thread Raw
In response to Re: [PATCH] Introduce array_shuffle() and array_sample()  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: [PATCH] Introduce array_shuffle() and array_sample()
List pgsql-hackers
Am 24.07.22 um 21:42 schrieb Fabien COELHO:
> 
> Duno. I'm still wondering what it should do. I'm pretty sure that the 
> documentation should be clear about a shared seed, if any. I do not 
> think that departing from the standard is a good thing, either.

Are sure it violates the standard? I could not find anything about it. 
The private prng state for random() was introduced in 2018 [0]. Neither 
commit nor discussion mentions any standard compliance.

[0] 
https://www.postgresql.org/message-id/E1gdNAo-00036g-TB%40gemulon.postgresql.org

I updated the documentation for setseed().

> If someone wants a limit, they can easily "LEAST(#1 dim size, other 
> limit)" to get it, it is easy enough with a strict function.

Convinced. It errors out now if n is out of bounds.

Martin
Attachment

pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Handle infinite recursion in logical replication setup
Next
From: Pierre Ducroquet
Date:
Subject: log_line_prefix: make it possible to add the search_path