Re: Proposal to introduce a shuffle function to intarray extension
Martin Kalcher <martin.kalcher@aboutsource.net>
From: Martin Kalcher <martin.kalcher@aboutsource.net>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Thomas Munro <thomas.munro@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-07-17T09:54:22Z
Lists: pgsql-hackers, pgsql-general
Am 17.07.22 um 05:32 schrieb David G. Johnston:
>
> +SELECT sample('{1,2,3,4,5,6,7,8,9,10,11,12}', 6) !=
> sample('{1,2,3,4,5,6,7,8,9,10,11,12}', 6);
> + ?column?
> +----------
> + t
> +(1 row)
> +
>
> While small, there is a non-zero chance for both samples to be equal. This
> test should probably just go, I don't see what it tests that isn't covered
> by other tests or even trivial usage.
>
Hey David,
you are right. There is a small chance for this test to fail. I wanted
to test, that two invocations produce different results (after all the
main feature of the function). But it can probably go.
Martin
Commits
-
Add array_sample() and array_shuffle() functions.
- 888f2ea0a81f 16.0 landed
-
Use a separate random seed for SQL random()/setseed() functions.
- 6645ad6bdd81 12.0 cited