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 1r136k-0093uk-4E for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Nov 2023 11:21:58 +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 1r136i-00DCAh-H8 for pgsql-bugs@arkaria.postgresql.org; Thu, 09 Nov 2023 11:21:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r136i-00DCAZ-57 for pgsql-bugs@lists.postgresql.org; Thu, 09 Nov 2023 11:21:56 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r136e-005WSL-GD for pgsql-bugs@lists.postgresql.org; Thu, 09 Nov 2023 11:21:55 +0000 Received: from [192.168.1.33] (cm-27-145-170-65.revip12.asianet.co.th [27.145.170.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: a.lepikhov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 25F09E20E5C; Thu, 9 Nov 2023 14:21:48 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1699528910; bh=4LmnwQ+24jU0fJuMdmFUTsGPsGUSZYuv9qmSPX0gPOg=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=xu/FZvEb0/QfzY87YI4zNw1bd8M+g0NPy7WucHz32EAcKY6LFz2UkUJ1IGqIKplJF fRv28eGdF4VmE6lBtM67v3GNC7kZEBtiCRNSWUup8qOvM5JVE8OakxETjK1xWVa4oA ZAPvsEh+hwHPhVLqStxAz2+hV2EjK3mW4/awP7nEHHHuANpokuzDk10wTYJ4N3GTVh x84RpyYC+oecK2W6lxmm9tl9mwgjQSJenRPRWrkDRm1dVWJbHNcrU3W7kp6OuSn8Tb e8jv+zNU6ti9co1mbfPqBosXD7xViOcWpkYcagkUigTNcZcUMGYVci3cPCuz9SIUX6 +fFkOyaqzQGHQ== Message-ID: Date: Thu, 9 Nov 2023 18:21:46 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #18187: Unexpected error: "variable not found in subplan target lists" triggered by JOIN Content-Language: en-US To: Richard Guo , Alexander Korotkov Cc: zuming.jiang@inf.ethz.ch, pgsql-bugs@lists.postgresql.org, PG Bug reporting form References: <18187-831da249cbd2ff8e@postgresql.org> <491881ef-f1c7-4a86-b5dd-dcad55a88ab4@postgrespro.ru> From: Andrei Lepikhov Organization: Postgres Professional In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/11/2023 18:08, Richard Guo wrote: > > On Thu, Nov 9, 2023 at 12:51 PM Andrei Lepikhov > > wrote: > > ... Should we add a reference to the > bug that triggered the issue as a comment to the test? > > > Yeah, we can do that.  I guess something like: > > -- Check that SJE removes references from PHVs correctly (bug #18187) > > Also, to be sure, > maybe add column t4.code into the list of the coalesce parameters? > > > I don't think it's necessary.  It is t3 that SJE would remove, so it's > sufficient to have t3's Vars in the PHV expression to trigger this > error. Agree. I've considered the situations when something in the internal planner logic changes, and relations could arrive in a different order. In that case, we sort relids, and have determined behaviour. So, do we wait for Alexander's glance? -- regards, Andrei Lepikhov Postgres Professional