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 1m2wtr-0004BT-5y for pgsql-general@arkaria.postgresql.org; Mon, 12 Jul 2021 14:27:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m2wtq-0003At-6F for pgsql-general@arkaria.postgresql.org; Mon, 12 Jul 2021 14:27:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2wtp-00039H-TX for pgsql-general@lists.postgresql.org; Mon, 12 Jul 2021 14:27:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2wtj-0008Tg-Qb for pgsql-general@lists.postgresql.org; Mon, 12 Jul 2021 14:27:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 16CER1JF2947770; Mon, 12 Jul 2021 10:27:01 -0400 From: Tom Lane To: Dean Rasheed cc: "David G. Johnston" , David Rowley , "pgsql-generallists.postgresql.org" Subject: Re: Undocumented array_val[generate_series(...)] functionality? In-reply-to: References: Comments: In-reply-to Dean Rasheed message dated "Mon, 12 Jul 2021 08:10:10 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2947768.1626100021.1@sss.pgh.pa.us> Date: Mon, 12 Jul 2021 10:27:01 -0400 Message-ID: <2947769.1626100021@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dean Rasheed writes: > BTW, this is something that started working in PG10 (in 9.6, an error > is thrown), and I think that it's a result of this release note item, > which matches your conclusions: > Change the implementation of set-returning functions appearing in > a query's SELECT list (Andres Freund) Interesting. When I first looked at this thread I figured "oh, that's always worked, nothing to see here". But you're right, we didn't use to allow SRFs in subscripts. Still, I'm with David that no new docs are needed. IMO the former restriction was the surprising thing, and the current behavior is simply what one would expect from assembling those parts in that order. regards, tom lane