Re: Query result differences between PostgreSQL 17 vs 16

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, David Rowley <dgrowleyml(at)gmail(dot)com>, Ronald Cruz <cruz(at)rentec(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, Peter Ford <pford(at)rentec(dot)com>, "Aaron J(dot) Garcia" <agarcia(at)rentec(dot)com>
Subject: Re: Query result differences between PostgreSQL 17 vs 16
Date: 2025-02-26 07:03:30
Message-ID: CAMbWs4_SqFDZ1Mnp0Kmy-H2s7_-PdeuXva+kBG-jKSampoDHnw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Feb 26, 2025 at 3:26 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> > Here is the patch.

> Thanks for that. The code and comment added to
> restriction_is_always_true look good, but I can't help wondering
> whether we don't need the same in restriction_is_always_false.
> Not very sure what a query proving the need for that would
> look like, but leaving it asymmetric feels wrong.

Yeah, I think you are right. The thing here is that we don't have a
reliable way to determine if the input expression of a NullTest is
non-nullable if it's a clone clause. This applies to both
restriction_is_always_true and restriction_is_always_false. So I
think we should add the same check in restriction_is_always_false too.

I'll give it a try to find a query that shows this is necessary.

Thanks
Richard

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2025-02-26 08:46:27 Re: Query result differences between PostgreSQL 17 vs 16
Previous Message Tom Lane 2025-02-26 06:26:09 Re: Query result differences between PostgreSQL 17 vs 16