Re: array_random

Поиск
Список
Период
Сортировка
От jian he
Тема Re: array_random
Дата
Msg-id CACJufxH89EiwapAfOQOqMMQWw11RYb=N68N=BF17KJ7x=O9dFQ@mail.gmail.com
обсуждение исходный текст
Список pgsql-hackers
On Mon, Jun 30, 2025 at 11:04 PM jian he <jian.universality@gmail.com> wrote:
>
> demo:
> SELECT array_random(1, 6, array[2,5], array[2,4]);
>              array_random
> --------------------------------------
>  [2:3][4:8]={{6,2,2,5,4},{4,5,6,4,6}}
>
> reasons for adding array_random is:
> 1. This is better than array_fill. This can fill random and constant
> values (random, min and max the same).
> 2.  Building a multi-dimensional PL/pgSQL function equivalent to
> array_random is not efficient and is also not easier.
>
> [1] https://www.postgresql.org/message-id/CACJufxGRCP19Rm66%3DTSBwmEuVr92FwL_e6YFjmCpJrgu6Km9hQ%40mail.gmail.com

i didn't use ./src/include/catalog/duplicate_oids
then there is some duplicated oid issue.
the attached patch fixes this issue.

Вложения

В списке pgsql-hackers по дате отправления: