Re: BUG #18997: Two equivalent queries return different results

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jinhui-lai(at)foxmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18997: Two equivalent queries return different results
Date: 2025-07-24 17:33:36
Message-ID: 1672783.1753378416@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> I think these "SELECT COUNT(c0) FILTER (WHERE c0 IS NOT NULL) FROM t0" and
> "SELECT COUNT(c0) FROM t0 WHERE c0 IS NOT NULL;" are equivalent. However,
> their results are different.

You sure your server is 17.5, and not something a little older?
There was a bug of this sort in earlier 17.x releases, but
we fixed it in 17.5. For me, both queries produce "0" as
expected.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jinhui Lai 2025-07-24 17:49:54 Re: BUG #18997: Two equivalent queries return different results
Previous Message Nathan Bossart 2025-07-24 16:30:49 Re: BUG #18964: `ALTER DATABASE ... RESET ...` fails to reset extension parameters that no longer exist