Re: Incorrect NOT IN results with implicit casts returning NULL after anti-join optimization

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: BHUVAN CHILUKUTI <c(dot)bhuvan(at)iitg(dot)ac(dot)in>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Guofenglinux <guofenglinux(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Incorrect NOT IN results with implicit casts returning NULL after anti-join optimization
Date: 2026-11-01 03:15:58
Message-ID: CAGRkXqT5Dz5TTuigf4PMwwG9Xw64HD48eJC_ttg3zpWQQ+hsqA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Bhuvan,

Thanks for reporting it. I can reproduce this on master and on
REL_19_STABLE. It is a v19 regression from 383eb21ebff.

One concern from code. The patch also removes the anti-join fo
built-in casts, which never return NULL.

numeric_col NOT IN (SELECT int_col ...)
text_col NOT IN (SELECT char_col ...)

Could we keep the anti-join for built-in cast functions, and use the
SubPlan only for user-defined ones?

Thanks,
Shihao

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message BHUVAN CHILUKUTI 2026-11-01 03:37:55 Re: Incorrect NOT IN results with implicit casts returning NULL after anti-join optimization
Previous Message Alex Speller 2026-11-01 01:26:26 Lost walsender wakeup stalls synchronous commits until the standby's next reply (16+)