pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Martin Kalcher <martin.kalcher@aboutsource.net>
Cc: John Naylor <john.naylor@enterprisedb.com>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: [PATCH] Introduce array_shuffle() and array_sample()
Date: Fri, 22 Jul 2022 12:49:10 -0400
Message-ID: <5550d5cb-ba8a-436b-cb9d-ae638ce13a24@joeconway.com> (raw)
In-Reply-To: <1064800.1658240423@sss.pgh.pa.us>
References: <9d160a44-7675-51e8-60cf-6d64b76db831@aboutsource.net>
	<4077925.1658029046@sss.pgh.pa.us>
	<CA+hUKGLcjrJ9Q2OZAKHN-SQyq_m5QDv8d3WKHYq5HW8Lyozu4w@mail.gmail.com>
	<5ef15c6f-e108-53af-3d82-587fac394f1a@aboutsource.net>
	<463181.1658097987@sss.pgh.pa.us>
	<5b7a1ee9-f942-2502-3a0c-e9fc12511139@aboutsource.net>
	<469954.1658100033@sss.pgh.pa.us>
	<f36445ec-aad9-0531-39f8-ca3a3bb4860e@aboutsource.net>
	<CAFBsxsG_PK3BkhMcfeLmwDS+FBDZKAaUtfrb6KjU79FZ-3H46A@mail.gmail.com>
	<687490.1658152096@sss.pgh.pa.us>
	<1708d95a-629e-5ac5-deab-d20a8d0b2b0e@aboutsource.net>
	<CA+TgmoaPKwPqhmrk7i1jRjqqt5=JDLeGze5wYPav5ietV4OFbw@mail.gmail.com>
	<809171.1658176490@sss.pgh.pa.us>
	<817328.1658178181@sss.pgh.pa.us>
	<0b5dea2b-37fa-6c81-ea9d-0341ab6f87d6@aboutsource.net>
	<091a9f69-1e5d-6558-41a7-2607a5fc9ff7@aboutsource.net>
	<87066868-3ebe-c632-3! e25-0cdad9cf1b1a@dunslane.net>
	<CA+TgmoYqC42KS7mypjMKxvGY2oPYz=_kvf1zcDNdawXXiVXqQA@mail.gmail.com>
	<1064800.1658240423@sss.pgh.pa.us>

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.localdoma...

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





view thread (51+ messages)  latest in thread

Message-ID: <5550d5cb-ba8a-436b-cb9d-ae638ce13a24@joeconway.com>
Permalink:  ../5550d5cb-ba8a-436b-cb9d-ae638ce13a24@joeconway.com/
Also on:    postgresql.org/message-id/5550d5cb-ba8a-436b-cb9d-ae638ce13a24@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: mail@joeconway.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, andrew@dunslane.net, martin.kalcher@aboutsource.net, john.naylor@enterprisedb.com, thomas.munro@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: [PATCH] Introduce array_shuffle() and array_sample()
  In-Reply-To: <5550d5cb-ba8a-436b-cb9d-ae638ce13a24@joeconway.com>
  References: <9d160a44-7675-51e8-60cf-6d64b76db831@aboutsource.net> <4077925.1658029046@sss.pgh.pa.us> <CA+hUKGLcjrJ9Q2OZAKHN-SQyq_m5QDv8d3WKHYq5HW8Lyozu4w@mail.gmail.com> <5ef15c6f-e108-53af-3d82-587fac394f1a@aboutsource.net> <463181.1658097987@sss.pgh.pa.us> <5b7a1ee9-f942-2502-3a0c-e9fc12511139@aboutsource.net> <469954.1658100033@sss.pgh.pa.us> <f36445ec-aad9-0531-39f8-ca3a3bb4860e@aboutsource.net> <CAFBsxsG_PK3BkhMcfeLmwDS+FBDZKAaUtfrb6KjU79FZ-3H46A@mail.gmail.com> <687490.1658152096@sss.pgh.pa.us> <1708d95a-629e-5ac5-deab-d20a8d0b2b0e@aboutsource.net> <CA+TgmoaPKwPqhmrk7i1jRjqqt5=JDLeGze5wYPav5ietV4OFbw@mail.gmail.com> <809171.1658176490@sss.pgh.pa.us> <817328.1658178181@sss.pgh.pa.us> <0b5dea2b-37fa-6c81-ea9d-0341ab6f87d6@aboutsource.net> <091a9f69-1e5d-6558-41a7-2607a5fc9ff7@aboutsource.net> <CA+TgmoYqC42KS7mypjMKxvGY2oPYz=_kvf1zcDNdawXXiVXqQA@mail.gmail.com> <1064800.1658240423@sss.pgh.pa.us> <5550d5cb-ba8a-436b-cb9d-ae638ce13a24@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox