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.96) (envelope-from ) id 1wF6mX-004kiV-1d for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Apr 2026 08:48:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wF6mW-007hFU-2h for pgsql-bugs@arkaria.postgresql.org; Tue, 21 Apr 2026 08:48:32 +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.96) (envelope-from ) id 1wF5jF-007MSS-2I for pgsql-bugs@lists.postgresql.org; Tue, 21 Apr 2026 07:41:05 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wF5j9-000000023Cw-1MUs for pgsql-bugs@lists.postgresql.org; Tue, 21 Apr 2026 07:41:04 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4838c15e3cbso35321825e9.3 for ; Tue, 21 Apr 2026 00:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776757258; cv=none; d=google.com; s=arc-20240605; b=a6PZF1rhuYTLJXCQbnxJmIQvTnG58j2j+TpARlrWaCRPBVK6knVwIDFlODf+EvZumB hwOp67KyU4G8JpwITjX/IdwVhK0ENINphHtefNGHfIbezToG1ypF4iyEixcN6w50o3xR QFpJ9//EO2+bQ32RstlgTLB7KZzG0CrJpk7/3l5LFAetd63phzsSo/YAkx++2W71OLWQ bb9hmc0VATJj+JIZDb3oCySh5tZX/rw7mTXD8G0SEia75JpaczP9wfHNsRzRUYjLSMPG n/EbpEykgpu/fTB+etZZtc6yG87Hma/kwDtYB2qzKcL3c3c5dCC32N7CBvHEjItQWUU5 T1+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=a5cHTa9zNq/X0O3uOxMKUvUtT0kb5DOE0jisMcj8PU8=; fh=LGHSrk3d6db+WxR0K5pGczwaCuMYnzVqmOXq/VFG9II=; b=lALnq1OU36nvNi2KO9hGQPXI7hWDdyb+yQKe0Ye4Cf7j4zxEPLn4hgXbkJBphooP9C B7W4QhwPaBjSqeK4ol1aLHHmh75W7elnZV3fSN1WUcJjM7jw5x7w3sIrHeGVERJBv0eM R1xDgf6az2EHzUDbcRc/y+i6zItyZTXTfGa3LawDClo32a0Vw2laXCTYV4U2VhojEG32 /gOttN1fZOSwt/1Dut7StS8NkB+QKVLqhhG15ZYUPFfO2cR9j4KJNpMXFX1ODx5FOdfV S/DavXri1yFXyz0SUXj1Xwo8HFqZyN4tCnmzqlG3Ss4jHfbGkDW1ljnxn/7sePFMjcDD B2Aw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pigment.com; s=google; t=1776757258; x=1777362058; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=a5cHTa9zNq/X0O3uOxMKUvUtT0kb5DOE0jisMcj8PU8=; b=I1x+v3Nzr7ZD/e6/ugr4Ih3G0J0qlULN7H4P6RDq6UdyJLQhMOINd0zOxX2AwAUhuu X63hafEpVuAO/IqpjiWOBs2qel4rhuax7ew5KtPUX1+8DdFwADBtkYnzQvVcj9WPEXxn uOaq0uAjdD+ZugjFwVLu5EUdsFDs7i/l83qRbMSMXU2snTs7ZY7rrEAHSB2bH25gPlUr /6S9L9uD2w7v4bjCLtT55QJcMH2b6UsshiMASwb7rec37LQdy8V478zTqy23oka9nK7t rfjUE7jNdg8i0xpmck2RED39R/dmttEQVqNo8qdrgqI80QHziNtCLdftEWAAyhAFh94X v3iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776757258; x=1777362058; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=a5cHTa9zNq/X0O3uOxMKUvUtT0kb5DOE0jisMcj8PU8=; b=G0S5DDS68dyWVbCsNr4h3zz8NIr5Q+gXpBKz7BJbAPNPGOGge/VYUl7/VUVgrd4Vvn PLBQqX02ZJVReMC9CU1fuDeC0VrNYLc4zuS5NGCyQQ+EcNKVE41nrLWBzHFCJpAzHUR0 qLy/Ko5lUMFXZALRMX/j5JG/kiL+EAMYsQtcO/P6zsotvFEfhwKThnPH5qCICM6Wl8S0 UTMdHJzDGLL/01S+otOq1FlZqW16L1htJc7eFcdw3qXhhNXm76Lt9eEAmBlg7G9Fl0PY iZNVACb6g73TX/88N9u29oXg0RVMK3GU67vURAum4NPFte/sU3OtruN11xJ8GNogW3DN Pw0A== X-Forwarded-Encrypted: i=1; AFNElJ/QOtWum/yl+aAr0CX7BrYjwJ/jRmSP7TaaZYxu5BJGklxz4glYV94D97O/lTTVVzeyhRrf/pnZiepH@lists.postgresql.org X-Gm-Message-State: AOJu0YypYFwCRsMUu33JpKOw1gqVxz5ZUcEqKd9ohZ/u7NxnFOORmDeF U1nM58lvpFfuyuahOrmIsxX/QTmn69q9D29GYjcs3x1okz8ZAbkNPoDB3GfT/js0OsZ7XIyY8T+ rGPrh890IpW5XPxL+0G9RXNpEKPRTy2dgmn2reBTO+Q== X-Gm-Gg: AeBDieuY42VJqbLe+wcJYMwJ67xpEeMbhAFsQ+4/mONPvjnjfNHakM3d57+ZfRkK1a+ 4iV/QZRrDUcBbPUYtey0JPq1o2RmLmgsPPlikWpx3TGl9gp7eSHWgPqfZK/cIHEiiHFDz+E47Y7 KpOA00NekJ+blzsbM/Jiut2hIMLCK2IVUzhLaEzpj3KLjjmr9H3ihv70PvTgfBeqYKqAit7cWHL i4LA3FtrmRi8Pf5sVYwkN775JodarVKsuD9lki4UU6bWhXddZjIy0VpBse+6kBruAQX7RiavWQ+ W03MVG1lLG1Ons+bNPiv3F0ecr8m/LAk87oaeNJJqy1/vukNuYsusHKVUzKRjKY= X-Received: by 2002:a05:600c:1e09:b0:48a:557e:6b4f with SMTP id 5b1f17b1804b1-48a557e6c16mr22427375e9.23.1776757258149; Tue, 21 Apr 2026 00:40:58 -0700 (PDT) MIME-Version: 1.0 References: <19460-5625143cef66012f@postgresql.org> <53936.1776633020@sss.pgh.pa.us> <81857.1776648374@sss.pgh.pa.us> <88899.1776652344@sss.pgh.pa.us> <418974.1776711680@sss.pgh.pa.us> <420865.1776712988@sss.pgh.pa.us> <458729.1776724816@sss.pgh.pa.us> In-Reply-To: From: =?UTF-8?Q?Fran=C3=A7ois_Jehl?= Date: Tue, 21 Apr 2026 09:40:47 +0200 X-Gm-Features: AQROBzAA5Tn7OhvGBt0zOfy1LnC87fieYaBn97Z6m4uVGW5KXA8hQH8F8ExH7kU Message-ID: Subject: Re: BUG #19460: FULL JOIN rewriting issue on empty queries To: Richard Guo Cc: Tom Lane , pgsql-bugs@lists.postgresql.org, Robert Haas Content-Type: multipart/alternative; boundary="0000000000003976cd064ff38987" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003976cd064ff38987 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Tom and Richard for the quick diagnosis and fix, I should be the one saying thanks here! Fran=C3=A7ois On Tue, Apr 21, 2026 at 1:04=E2=80=AFAM Richard Guo wrote: > On Tue, Apr 21, 2026 at 7:40=E2=80=AFAM Tom Lane wrot= e: > > Ah: equivclass.c doesn't mind letting em->em_relids be an alias > > for the left_relids or right_relids of some source RestrictInfo. > > That's not problematic as long as those are all constants after > > construction of the EquivalenceClass, but when remove_rel_from_eclass > > is trying to change things, it's a big problem. > > ha, I just came to the same conclusion. > > > This seems to do the trick to fix it, although I'm going to wait > > for a valgrind regression run to finish before deciding this > > is enough: > > This seems safe enough to me. LGTM. > > - Richard > --0000000000003976cd064ff38987 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Tom and Richard for the quick diagnosis and fix, I = should be the one saying thanks here!

Fran=C3=A7ois

On Tue, Apr 21, 2026 at 1:04=E2=80=AFAM Richard Guo = <guofenglinux@gmail.com>= ; wrote:
On Tue,= Apr 21, 2026 at 7:40=E2=80=AFAM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Ah: equivclass.c doesn't mind letting em->em_relids be an alias=
> for the left_relids or right_relids of some source RestrictInfo.
> That's not problematic as long as those are all constants after > construction of the EquivalenceClass, but when remove_rel_from_eclass<= br> > is trying to change things, it's a big problem.

ha, I just came to the same conclusion.

> This seems to do the trick to fix it, although I'm going to wait > for a valgrind regression run to finish before deciding this
> is enough:

This seems safe enough to me.=C2=A0 LGTM.

- Richard
--0000000000003976cd064ff38987--