pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: jinhui-lai@foxmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18997: Two equivalent queries return different results
Date: Thu, 24 Jul 2025 13:33:36 -0400
Message-ID: <1672783.1753378416@sss.pgh.pa.us> (raw)
In-Reply-To: <18997-5da9d229e6f13364@postgresql.org>
References: <18997-5da9d229e6f13364@postgresql.org>

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





view thread (3+ messages)  latest in thread

Message-ID: <1672783.1753378416@sss.pgh.pa.us>
Permalink:  ../1672783.1753378416@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1672783.1753378416@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jinhui-lai@foxmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18997: Two equivalent queries return different results
  In-Reply-To: <1672783.1753378416@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox