Re: BUG #18997: Two equivalent queries return different results
Jinhui Lai <jinhui-lai@foxmail.com>
From: Jinhui Lai <jinhui-lai@foxmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Date: 2025-07-24T17:49:54Z
Lists: pgsql-bugs
Dear Tom Lane,
Sorry for my careless. I check my PG version again, it is 17.4. Since my PG docker' tag is latest, I mistakenly thought it was the latest version (17.5).
Thanks for your reply.
Best regards,
Jinhui
原始邮件
发件人:Tom Lane <tgl@sss.pgh.pa.us>
发件时间:2025年7月25日 01:33
收件人:jinhui-lai <jinhui-lai@foxmail.com>
抄送:pgsql-bugs <pgsql-bugs@lists.postgresql.org>
主题:Re: BUG #18997: Two equivalent queries return different results
PG Bug reporting form <noreply@postgresql.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