Re: [PATCH] Introduce array_shuffle() and array_sample()

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Martin Kalcher <martin(dot)kalcher(at)aboutsource(dot)net>, John Naylor <john(dot)naylor(at)enterprisedb(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Introduce array_shuffle() and array_sample()
Date: 2022-07-22 16:49:10
Message-ID: 5550d5cb-ba8a-436b-cb9d-ae638ce13a24@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 7/19/22 10:20, Tom Lane wrote:
> Everything else either explicitly rejects more-than-one-D arrays
> or does something that is compatible with thinking of them as
> arrays-of-arrays.

I think I am responsible for at least some of those, and I agree that
thinking of MD arrays as arrays-of-arrays is preferable even though they
are not actually that. Long ago[1] Peter E asked me to fix that as I
recall but it was one of those round tuits that I never found.

> So I withdraw my original position. These functions should just
> shuffle or select in the array's first dimension, preserving
> subarrays. Or else be lazy and reject more-than-one-D arrays;
> but it's probably not that hard to handle them.

+1

Joe

[1]
https://www.postgresql.org/message-id/flat/Pine.LNX.4.44.0306281418020.2178-100000%40peter.localdomain#a064d6dd8593993d799db453a3ee04d1

--
Joe Conway
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2022-07-22 17:31:31 Re: How does postgres sort large strings?
Previous Message Adrian Klaver 2022-07-22 15:52:47 Re: 20220722-pg_dump: error: invalid number of parents 0 for table

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2022-07-22 17:21:54 Re: let's disallow ALTER ROLE bootstrap_superuser NOSUPERUSER
Previous Message Önder Kalacı 2022-07-22 16:15:16 Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher