From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: jinhui-lai@foxmail.com
Subject: BUG #18990: The results of equivalent queries are inconsistent (one returns 0, another returns -0)
Date: Thu, 17 Jul 2025 11:30:40 +0000
Message-ID: <18990-a8cecf16fb02d7b0@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18990
Logged by: Jinhui
Email address: jinhui-lai@foxmail.com
PostgreSQL version: 17.5
Operating system: ubuntu 22.04
Description:
Hi, PG developers
Thanks for reading my report!
You can reproduce it as follows:
SELECT DISTINCT t1.c0 FROM t1 WHERE NOT EXISTS (SELECT 1 FROM t0 WHERE t1.c0
> t0.c0)
UNION
SELECT DISTINCT t1.c0 FROM t1 WHERE EXISTS (SELECT 1 FROM t0 WHERE t1.c0 >
t0.c0);
c0
----
-4
-3
-2
-1
-0
1
SELECT DISTINCT t1.c0 FROM t1;
c0
----
0
-2
-1
-4
-3
1
Thanks once again for your precious time.
Best regard,
Jinhui
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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, jinhui-lai@foxmail.com
Subject: Re: BUG #18990: The results of equivalent queries are inconsistent (one returns 0, another returns -0)
In-Reply-To: <18990-a8cecf16fb02d7b0@postgresql.org>
* 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