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 1oDDLL-0004HS-17 for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Jul 2022 23:06:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDDKL-0005QD-Rv for pgsql-hackers@arkaria.postgresql.org; Sun, 17 Jul 2022 23:05:29 +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 1oDDKL-0005Q4-HJ for pgsql-hackers@lists.postgresql.org; Sun, 17 Jul 2022 23:05:29 +0000 Received: from mout-b-203.mailbox.org ([2001:67c:2050:102:465::203]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDDKJ-0004Qp-3J for pgsql-hackers@lists.postgresql.org; Sun, 17 Jul 2022 23:05:29 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-203.mailbox.org (Postfix) with ESMTPS id 4LmLKY6WfRz9sVN; Mon, 18 Jul 2022 01:05:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aboutsource.net; s=MBO0001; t=1658099121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vk4Xpj9clh7hvwKqoyVNhQj+cZuif00VRClV1IgIdXM=; b=RtihJpmWrzuQW2wRKcZGtErfXNWAmDhu8JJ/8ysvObHibX9Vt2RFyvE8FdJDVIE/1pGbv1 Iagi9PBp7kgaS/plQHl8R1WF9IDFzv9uXu8fyOtoR+JZFUFF0/ju38hBB3ZhlDl9TwzgWe V65QZmYQFCZ6uNFiwsDSrwoN8DzdguQhdJzrsRa900P1Jd3signE/XOysmhepVOZmpMJ5J ji4VX1/6MMAwcOwct9YQdf5jKQvUUXJWkJECIrVRjfba1+f+GdIF44NhTmo/Bn+Vr0QypN Kly5KHPPPtYAQfFsYz3Q5v4Ku1B5AwYPyNMTsvtFRg7/0jcAa73zW8JdYpimQg== Message-ID: <5b7a1ee9-f942-2502-3a0c-e9fc12511139@aboutsource.net> Date: Mon, 18 Jul 2022 01:05:19 +0200 MIME-Version: 1.0 Content-Language: de-DE To: Tom Lane Cc: Thomas Munro , PostgreSQL Hackers References: <9d160a44-7675-51e8-60cf-6d64b76db831@aboutsource.net> <4073858.1658027909@sss.pgh.pa.us> <4077925.1658029046@sss.pgh.pa.us> <5ef15c6f-e108-53af-3d82-587fac394f1a@aboutsource.net> <463181.1658097987@sss.pgh.pa.us> From: Martin Kalcher Subject: Re: Proposal to introduce a shuffle function to intarray extension In-Reply-To: <463181.1658097987@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 Am 18.07.22 um 00:46 schrieb Tom Lane: > > This does not look particularly idiomatic, or even type-safe. What you > should have done was use deconstruct_array to get an array of Datums and > isnull flags, then shuffled those, then used construct_array to build the > output. > > (Or, perhaps, use construct_md_array to replicate the input's > precise dimensionality. Not sure if anyone would care.) > > regards, tom lane deconstruct_array() would destroy the arrays dimensions. I would expect that shuffle() only shuffles the first dimension and keeps the inner arrays intact. Martin