On Fri, Jul 11, 2025 at 3:49 PM Dean Rasheed <dean.a.rash...@gmail.com> wrote:
>
> On Tue, 8 Jul 2025 at 15:26, Aleksander Alekseev
> <aleksan...@tigerdata.com> wrote:
> >
> > The proposed function seems to do two things at a time - generating
> > random values and transforming them into an array of desired
> > dimensions. Generally we try to avoid such interfaces. Can you think
> > of something like array_transform() / array_reshape() that takes an
> > arbitrary single-dimension array and modifies it?
>
> That's a good point. Arguably, creating a simple 1-D array of random
> values is trivial enough to leave to users, and there isn't sufficient
> demand to justify creating core functions for it.
>
use sql, we generally do something like:
select array_agg(random(1, 10)) from generate_series(1, 2) g;
but its performance is worse than array_random.

Does performance and other factors justify adding array_random?


Reply via email to