Hi everyone,
> >> Thanks for the detailed feedback! Here is the rebased version.
> >>
> >
> > I took another look at this and I think it's in reasonable shape.
> >
> > I'm attaching an update, rebasing it on top of 9be4e5d293.
>
> Thank you Dean.
>
> > Also it was missing a required update to the meson.build file --
> > that's the immediate cause of the other cfbot failures.
>
> OK, great to know this one, I should have paid more attention to cfbot.
>
> > The rest is just cosmetic tidying up, fixing indentation, tweaking
> > comments, and the like. I also hacked on the docs a bit -- the
> > synopsis only listed one of the new function signatures for some
> > reason. After fixing that, I think it's sufficient to just list one
> > usage example.
>
> That looks better now, more concise and expressive sentences.
I played with patch v3. All in all it seems to be in good shape.
I wonder though whether tablefunc extension is the right place for the
function. To me it seems to be as useful as array_shuffle().
Personally I would name the function array_rand() in order to be
consistent with the rest of array_* functions [1].
I would also replace `minlen` and `maxlen` arguments with a single
`len` argument because the same result (although more slowly) can be
achieved like this:
SELECT trim_array(arr, random(0,3)) FROM rand_array(10, 3, 3, 50::int,
80::int) as arr;
This could be just a bike-shedding though. Does anyone feel necessary
to second any of these nitpicks?
[1]: https://www.postgresql.org/docs/current/functions-array.html
--
Best regards,
Aleksander Alekseev