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 1oIdiy-0002oi-Mp for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Aug 2022 22:17:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oIdix-0004qh-8W for pgsql-bugs@arkaria.postgresql.org; Mon, 01 Aug 2022 22:17:19 +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 1oIdix-0004qY-0S for pgsql-bugs@lists.postgresql.org; Mon, 01 Aug 2022 22:17:19 +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 1oIdiq-0002ls-Id for pgsql-bugs@lists.postgresql.org; Mon, 01 Aug 2022 22:17:17 +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 271MHB502184336; Mon, 1 Aug 2022 18:17:11 -0400 From: Tom Lane To: kleptog@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17564: Planner bug in combination of generate_series(), unnest() and ORDER BY In-reply-to: <17564-c7472c2f90ef2da3@postgresql.org> References: <17564-c7472c2f90ef2da3@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 01 Aug 2022 14:54:30 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2184334.1659392231.1@sss.pgh.pa.us> Date: Mon, 01 Aug 2022 18:17:11 -0400 Message-ID: <2184335.1659392231@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > db=# explain SELECT generate_subscripts(ARRAY[]::integer[], 1) AS id, > unnest(ARRAY[]::jsonb[]) ->> 'timestamp' AS timestamp > FROM results > JOIN groups ON groups.id = results.group_id > WHERE results.search_id = 3336 > order by timestamp; > The error is: > ERROR: set-valued function called in context that cannot accept a set > LINE 2: unnest(ARRAY[]::jsonb[]) ->> 'timestamp' AS timestam... Hmm, that certainly seems like a bug, but I fear it's impossible to investigate without a reproducible test case. regards, tom lane