Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1CA0-000561-MA for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Mar 2019 15:39:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1C9z-00068h-EX for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Mar 2019 15:39:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1C9z-00067W-7x for pgsql-bugs@lists.postgresql.org; Tue, 05 Mar 2019 15:39:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1C9w-0002zJ-PR for pgsql-bugs@lists.postgresql.org; Tue, 05 Mar 2019 15:39:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x25Fd7Ar019354; Tue, 5 Mar 2019 10:39:07 -0500 From: Tom Lane To: thibaut.madelaine@dalibo.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15669: Error with unnest in PG 11 (ERROR: 0A000) In-reply-to: <15669-02fb3296cca26203@postgresql.org> References: <15669-02fb3296cca26203@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 05 Mar 2019 11:06:00 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19352.1551800347.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 05 Mar 2019 10:39:07 -0500 Message-ID: <19353.1551800347@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > In PostgreSQL 10.7 and before, it is possible to run the following query= : > thibaut=3D# WITH test AS ( SELECT array[1,2] AS intarr ) = > SELECT unnest(intarr) AS lot_id FROM test WHERE false; > In version 11.2, the same query fails: > ERROR: 0A000: set-valued function called in context that cannot accept = a set Hmm, that's definitely a bug. It looks like we're forgetting to make a ProjectSet plan node for the unnest() if we realize that the query is a no-op; but I'm not sure why 10.x doesn't have the same issue. Digging ... regards, tom lane