Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oEvr0-000319-9C for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jul 2022 16:50:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oEvq1-00042K-4G for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jul 2022 16:49:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oEvq0-0003zc-R6 for pgsql-hackers@lists.postgresql.org; Fri, 22 Jul 2022 16:49:16 +0000 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oEvpy-0002zp-3w for pgsql-hackers@lists.postgresql.org; Fri, 22 Jul 2022 16:49:16 +0000 Received: by mail-qt1-x836.google.com with SMTP id e5so3928490qts.1 for ; Fri, 22 Jul 2022 09:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joeconway.com; s=google; h=message-id:date:mime-version:user-agent:content-language:to:cc :references:from:subject:in-reply-to:content-transfer-encoding; bh=rE+JMZEmqoYw8x0LaMmuCfXaKPQY58pbu8lfJ0gXHgQ=; b=HYUQBW8PFtyLfJhTQr14H12cN7bDqBsvx+f48QsC+9bmZXIkyLygF7HjyttmaOUyLl /LF3OsL/euuIui/ciLviU6PjkVFceSa2xexPi7caAVaGENy9+VsgvhTaIJ4wp6WN7vFG zVN0oq1kUO+jidCKJCpcg0kraiBHwh0wJtYEvFLnCArGx3uFuW2OF6boMeBK6qbk3Xrp lLLtFFO43EM2zDTWr68gIO+diLHH54nDURTExandyetxWG6/JnlvCfKKLjgiJ3fi+Im3 JtM6kZTxW5xoIOo4Yikm6xvId1ZzL59kIjo9+fQeI678GC38LSeP35rpqqd6tlgFU+/J iAsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=rE+JMZEmqoYw8x0LaMmuCfXaKPQY58pbu8lfJ0gXHgQ=; b=A+H9C+LYGc3Ih1XWfvUDdx08BxZiTN2qmiKuRORiacr1k2ZS0+oO98funzLL4JBKLo t4CLxGM1KJriwyvf8m+KWzJ18P2m/Evg4h6r7hKQrBeEUMAuEpuOGz8NtbjHSZm4mT/P YmbDYzRKt0eFIvMlsSpKrJ5QG8XdsGln67cStraJVHRrRN0BbVr9ze10bFMK4WwIZzD9 +295Hw/hzekesK7IIDMngJgL47XmOSjwKRBEXzdn4QCF3znoUMaIcO9lekhBLH3XiS0m G0E6SVwhDv/LDmy1x7b1/k2qEaD9TgMdFG4Oi2tbYIV40fJXqWrwA9Ei6Wxenyt5iI17 ff0g== X-Gm-Message-State: AJIora/MFFCXTbpyo9mWksQbPVaaUFw3SDOBTcOkL5WiWvwrIvyd/hNT i3minx6TR3xX34Kc4mvMTuHlJw== X-Google-Smtp-Source: AGRyM1tYMqgfXrC/lJDEmTTd4NPiRAPyvUGxULO3cchcfd491+n5kzIJ3Wra2CXzt37Zp3IoD8WsXg== X-Received: by 2002:a05:622a:53:b0:31f:1fb6:8d3a with SMTP id y19-20020a05622a005300b0031f1fb68d3amr938691qtw.386.1658508551860; Fri, 22 Jul 2022 09:49:11 -0700 (PDT) Received: from [192.168.4.41] (072-017-018-098.res.spectrum.com. [72.17.18.98]) by smtp.gmail.com with ESMTPSA id g4-20020ac87f44000000b0031eb3af3ffesm3420959qtk.52.2022.07.22.09.49.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Jul 2022 09:49:11 -0700 (PDT) Message-ID: <5550d5cb-ba8a-436b-cb9d-ae638ce13a24@joeconway.com> Date: Fri, 22 Jul 2022 12:49:10 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: Tom Lane , Robert Haas Cc: Andrew Dunstan , Martin Kalcher , John Naylor , Thomas Munro , PostgreSQL Hackers References: <9d160a44-7675-51e8-60cf-6d64b76db831@aboutsource.net> <4077925.1658029046@sss.pgh.pa.us> <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> <687490.1658152096@sss.pgh.pa.us> <1708d95a-629e-5ac5-deab-d20a8d0b2b0e@aboutsource.net> <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> <1064800.1658240423@sss.pgh.pa.us> From: Joe Conway Subject: Re: [PATCH] Introduce array_shuffle() and array_sample() In-Reply-To: <1064800.1658240423@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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