Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhYkt-003Ull-F3 for pgsql-bugs@arkaria.postgresql.org; Sat, 16 Sep 2023 17:06:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qhYkq-00GMRN-R4 for pgsql-bugs@arkaria.postgresql.org; Sat, 16 Sep 2023 17:06:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qhYkq-00GMQy-Dx for pgsql-bugs@lists.postgresql.org; Sat, 16 Sep 2023 17:06:48 +0000 Received: from tzirechnoy.static.corbina.ru ([78.107.237.199] helo=mail.mednm.com) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qhYkm-004vDM-Uc for pgsql-bugs@lists.postgresql.org; Sat, 16 Sep 2023 17:06:47 +0000 Received: from mail.tzirechnoy.ru (unknown [85.143.106.93]) by mail.mednm.com (Postfix) with ESMTPSA id 92BFF1010C08 for ; Sat, 16 Sep 2023 20:06:41 +0300 (MSK) Received: by mail.tzirechnoy.ru (Postfix, from userid 1000) id CAD52A42DC; Sat, 16 Sep 2023 20:06:39 +0300 (MSK) Date: Sat, 16 Sep 2023 20:06:39 +0300 From: Ilya Anfimov To: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18114: FULL JOIN is replaced by LEFT JOIN in plan Message-ID: Mail-Followup-To: Ilya Anfimov , pgsql-bugs@lists.postgresql.org References: <18114-c360a22e03a2fe2b@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Sep 16, 2023 at 11:32:15PM +1000, W??i C??ngru?? wrote: > This is not a bug. The row is filtered by the WHERE clause. > Sorry for disturbing. > > On Sat, Sep 16, 2023, 22:36 PG Bug reporting form > wrote: > > The following bug has been logged on the website: > > Bug reference: 18114 > Logged by: crvv > Email address: crvv.mail@gmail.com > PostgreSQL version: 16.0 > Operating system: Linux > Description: > > SELECT * FROM (VALUES (1)) AS t(id) > CROSS JOIN unnest('{1,2}'::int[]) AS a(x) > FULL JOIN unnest('{2,3}'::int[]) AS b(x) ON a.x = b.x > WHERE t.id = 1 > > Execute this SQL, I get the result > id | x | x > ----+---+--- > 1 | 1 | > 1 | 2 | 2 > > My expection is > id | x | x > ----+---+--- > 1 | 1 | > 1 | 2 | 2 > | | 3 Your expectation is incorrect. Last record has null t.id (not 1), so it was filtered out by WHERE.