Re: [GENERAL] Custom shuffle function stopped working in 9.6 - Mailing list pgsql-general

From Adrian Klaver
Subject Re: [GENERAL] Custom shuffle function stopped working in 9.6
Date
Msg-id adcf3b01-32c9-99b3-c81f-4c20d7b219db@aklaver.com
Whole thread Raw
In response to Re: [GENERAL] Custom shuffle function stopped working in 9.6  (Alexander Farber <alexander.farber@gmail.com>)
List pgsql-general
On 02/11/2017 10:51 AM, Alexander Farber wrote:
> At the same time this advice from
> http://stackoverflow.com/questions/42179012/how-to-shuffle-array-in-postgresql-9-6-and-also-lower-versions
> works, don't know why though:
>
> words=> select array_agg(u order by random())
> words-> from unnest(array['a','b','c','d','e','f']) u;
>    array_agg
> ---------------
>  {d,a,f,c,b,e}
>

To future proof your code follow the advice shown in the doc snippet in
the first answer to your SO question. This is what I showed in my
answers to your questions.

--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Alexander Farber
Date:
Subject: Re: [GENERAL] Custom shuffle function stopped working in 9.6
Next
From: Pavel Stehule
Date:
Subject: Re: [GENERAL] Custom shuffle function stopped working in 9.6