BUG #18990: The results of equivalent queries are inconsistent (one returns 0, another returns -0) - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18990: The results of equivalent queries are inconsistent (one returns 0, another returns -0)
Date
Msg-id 18990-a8cecf16fb02d7b0@postgresql.org
Whole thread Raw
Responses Re: BUG #18990: The results of equivalent queries are inconsistent (one returns 0, another returns -0)
List pgsql-bugs
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


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18989: Output of \sf does not match original source for E quoted strings (unlike \df+ used to)
Next
From: Álvaro Herrera
Date:
Subject: Re: BUG #18984: Empty prepared statement from psql \parse triggers assert in PortalRunMulti