Re: Wrong results from an antijoin - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Wrong results from an antijoin
Date
Msg-id CAMbWs4-nAQAyGeEKtcePaC8PPE3-Jfwr5T-9HmDEQseUfrsKSQ@mail.gmail.com
Whole thread
In response to Wrong results from an antijoin  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: Wrong results from an antijoin
List pgsql-hackers
On Fri, Oct 9, 2026 at 12:21 PM Richard Guo <guofenglinux@gmail.com> wrote:
> So I think a more principled way is to give the antijoin a relid, just
> like an antijoin reduced from a left join has, so that we can leverage
> the well-established outer-join relid machinery to keep quals above
> it.

> I'm writing a patch along these lines, but I'd like to hear what
> others think before going too far.

Here is the patch I end up with.

Of the join types that IS_OUTER_JOIN() covers, ANTI was the only one
that could lack a relid, and only when it came from a sublink.  Now
every outer join has one, so we no longer need the "if (j->rtindex !=
0)" checks in the code.

Any thoughts?

- Richard

Attachment

pgsql-hackers by date:

Previous
From: Ayush Tiwari
Date:
Subject: [PATCH] Clear walsender reader pointers after cleanup
Next
From: Ayush Tiwari
Date:
Subject: Re: [PATCH] Two remaining shmem attachment issues in single-user mode