Re: How to return ARRAY from SQL function? - Mailing list pgsql-general

From Tom Lane
Subject Re: How to return ARRAY from SQL function?
Date
Msg-id 20726.1560863425@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to return ARRAY from SQL function?  (Alexander Farber <alexander.farber@gmail.com>)
Responses Re: How to return ARRAY from SQL function?
List pgsql-general
Alexander Farber <alexander.farber@gmail.com> writes:
> And then I shuffle the letters by -

> CREATE OR REPLACE FUNCTION words_shuffle(in_array text[])
>         RETURNS text[] AS
> $func$
>         SELECT array_agg(x ORDER BY RANDOM()) FROM UNNEST(in_array) x;
> $func$ LANGUAGE sql STABLE;

Hmm ... that's not really "stable", since it depends on random()
which is volatile.

            regards, tom lane



pgsql-general by date:

Previous
From: Alexander Farber
Date:
Subject: Re: How to return ARRAY from SQL function?
Next
From: Adrian Klaver
Date:
Subject: Re: Connection refused (0x0000274D/10061)