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 1pRds8-00089V-6I for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Feb 2023 18:48:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pRds6-0003mI-P5 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Feb 2023 18:48:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pRds6-0003m8-Bg for pgsql-hackers@lists.postgresql.org; Mon, 13 Feb 2023 18:48:14 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pRds3-0004y1-L2 for pgsql-hackers@lists.postgresql.org; Mon, 13 Feb 2023 18:48:13 +0000 Received: by mail-io1-xd35.google.com with SMTP id y7so4824942iob.6 for ; Mon, 13 Feb 2023 10:48:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=zNR1GxTPhSUb4GzOMkE/wA1O7yH4q7lDK55IJ/wZCiY=; b=YwORJdtkZUccKWk+sx/pu+fC6rT221zZ2Jw1zcGAs1bCpRibTZMJla1RuDO/GbzIIf zlvsws9/tiWSs1GEHJyJNkFD+pdsmz7U+pA6JXPEudYkXj7VGxizTKlmhNFCpOgM8JVj 8MbZo5F8bFrBZrmn+pMOuz/rWfNY/Jh+eviMW1NUgfeXxvMLLxObyrxJL6N37C+shHtw GuHElDN8ERZeaQ27QyqJtQgJzink0FSFfJ1diQbXVBZjKgu4CABgRHutBd5Y+zL3CnrA JhEGIexjFZMEUijc4Jfw78zOttvunfST/FQfIDExubD7Yw2qeDFLTPTg3C6ywKKqxaGP /fEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zNR1GxTPhSUb4GzOMkE/wA1O7yH4q7lDK55IJ/wZCiY=; b=Di68+ZS16FI5D49OzbFbvVayKz7gz5wQUz0Luwg4uhXdJ/xvomdhMVQGo+VLndAqXx KD4UGVURw2I19RP9j34XnCu2efJ9S4q44kKI/Ns0gTw3tFAPrUoWzZzo3PrLjytkVX6/ lUxv5bWfcrIIv6im8QlWInc4MZRG/Njb+GKbdJ6nmZtDSPx3WoEEkbh+irYkpC6SlCoy 7sNXvuj2czsVai+NCU6UM07zb+Ot2xkcsakyqsWB/EPZQ44plJoymui1WtPgH8B1W11G qhK8XyseZqTsOw0/zlMkKW2/36R1Wgw3ADVE1eIwehYXyrledbEbj7Z5rHRW6IMjh19d m3sg== X-Gm-Message-State: AO0yUKXn7i9XOX18znLkBXSMkaaf+r4lB1f1HLY+W6gHTd32I6zHOAgu 49y8FMbWkw41O48dKyXrn4FWSw== X-Google-Smtp-Source: AK7set9bH7OuoPOzFmb7XVqx6rBchriN0Gq7M7uS2DIydHCpgJxxWspIUZJElHjhQMiNpZzAaIKfgg== X-Received: by 2002:a05:6602:130a:b0:723:23a5:f551 with SMTP id h10-20020a056602130a00b0072323a5f551mr23871341iov.1.1676314089611; Mon, 13 Feb 2023 10:48:09 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id j1-20020a02cb01000000b0039e98b2fe5dsm4185175jap.179.2023.02.13.10.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 10:48:09 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id E8099806200; Mon, 13 Feb 2023 12:48:07 -0600 (CST) Date: Mon, 13 Feb 2023 12:48:07 -0600 From: Justin Pryzby To: Richard Guo Cc: Tom Lane , pgsql-hackers@lists.postgresql.org, "Finnerty, Jim" Subject: Re: Making Vars outer-join aware Message-ID: <20230213184807.GF1653@telsasoft.com> References: <1035990.1667261942@sss.pgh.pa.us> <2901865.1667685211@sss.pgh.pa.us> <4019771.1672155080@sss.pgh.pa.us> <323812.1672241806@sss.pgh.pa.us> <2043562.1674506286@sss.pgh.pa.us> <20230212235823.GW1653@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Feb 13, 2023 at 03:33:15PM +0800, Richard Guo wrote: > On Mon, Feb 13, 2023 at 7:58 AM Justin Pryzby wrote: > > The patch broke this query: > > > > select from pg_inherits inner join information_schema.element_types > > right join (select from pg_constraint as sample_2) on true > > on false, lateral (select scope_catalog, inhdetachpending from > > pg_publication_namespace limit 3); > > ERROR: could not devise a query plan for the given query > BTW, here is a simplified query that can trigger this issue on HEAD. > > select * from t1 inner join t2 left join (select null as c from t3 left > join t4 on true) as sub on true on true, lateral (select c, t1.a from t5 > offset 0 ) ss; It probably doesn't need to be said that the original query was reduced from sqlsmith... But I mention that now to make it searchable. Thanks, -- Justin