Re: pgsql: Teach expr_is_nonnullable() to handle more expression types

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Richard Guo <rguo(at)postgresql(dot)org>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: Teach expr_is_nonnullable() to handle more expression types
Date: 2026-10-06 14:49:45
Message-ID: CA+TgmoaLcsmc9weJr1yo1X1SwZJX1t4XXHj0SJzH8XztmN9Hdg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, Dec 24, 2025 at 4:02 AM Richard Guo <rguo(at)postgresql(dot)org> wrote:
> Teach expr_is_nonnullable() to handle more expression types

Due to this commit, expr_is_nonnullable() claims that "IS DISTINCT
FROM never returns NULL", but execExprInterp.c's implementation for
EEOP_DISTINCT disagrees; when neither argument is NULL, it returns
null if the underlying operator does. Two Claude-written test cases
illustrating the problem are attached.

--
Robert Haas
Databricks

Attachment Content-Type Size
finding5.sql application/octet-stream 311 bytes
finding7.sql application/octet-stream 465 bytes

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2026-10-06 15:53:16 Re: pgsql: Reduce "Var IS [NOT] NULL" quals during constant folding
Previous Message Nathan Bossart 2026-10-06 14:05:53 pgsql: Fix COPY FROM ... WHERE for negated operators.

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2026-10-06 14:57:35 Re: Serverside SNI support in libpq
Previous Message Robert Treat 2026-10-06 14:49:12 Re: Proposal: SELECT * EXCLUDE (...) command