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

From Alexander Farber
Subject Re: How to return ARRAY from SQL function?
Date
Msg-id CAADeyWiHPfZB+bJgqJ3B4qMv47ju6zPZwnzXJJoLAf_bSvjrag@mail.gmail.com
Whole thread Raw
In response to Re: How to return ARRAY from SQL function?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Thank you -

On Tue, Jun 18, 2019 at 3:10 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
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.


I was wondering that too, but assumed it is maybe STABLE because the function does not modify any tables.

I will remove the STABLE keyword now

Regards
Alex

pgsql-general by date:

Previous
From: "Ahmed, Nawaz (Fuji Xerox Australia)"
Date:
Subject: RE: Max_connections limit
Next
From: Hitesh Chadda
Date:
Subject: migrating from Oracle to PostgreSQL 11