Re: array_random

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Aleksander Alekseev <aleksander(at)tigerdata(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Vik Fearing <vik(at)postgresfriends(dot)org>
Subject: Re: array_random
Date: 2025-07-21 03:49:12
Message-ID: 346143.1753069752@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

jian he <jian(dot)universality(at)gmail(dot)com> writes:
> Does performance and other factors justify adding array_random?

There hasn't really been field demand for such a function, AFAIR.
There's an infinite amount of stuff that would be faster if coded
in C than if written in SQL or plpgsql. We can't support it all,
so we need some fairly high bar to accepting what functionality
we'll support.

In the case at hand, "fill a 1-D array with random values" is
quite trivial to do in either SQL or plpgsql. However, "reshape
an array to have such-and-such dimensions" isn't. So in the abstract
I'd be more sympathetic to inventing a function that can do reshaping.
But there is still the question of whether anybody really needs that
functionality.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-07-21 04:00:25 Re: Conflict detection for update_deleted in logical replication
Previous Message jian he 2025-07-21 03:15:36 Re: array_random