BUG #19579: Wrong results regression

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: leis(at)in(dot)tum(dot)de
Subject: BUG #19579: Wrong results regression
Date: 2026-07-25 07:19:01
Message-ID: 19579-e6296b6c9fc0591c@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 19579
Logged by: Viktor Leis
Email address: leis(at)in(dot)tum(dot)de
PostgreSQL version: 19beta2
Operating system: Ubuntu 26.04 LTS
Description:

Hi,

The following self-contained query returns rows on current master and on
19beta2, but should return nothing. PostgreSQL 18 and earlier are
unaffected.

select * from
(select 0 as c0 from
(select t1.c0 from
(select null::int as c0 from ((select 1) union all (select 2)) t0)
t1
full join (select 1 as c1 where false) t2 on true) t3
where c0 <> 7) t4
cross join (select * from (values (0::bigint)) v(x)
where now() is not null) t5;

c0 | x
----+---
0 | 0
0 | 0
(2 rows)

t1.c0 is a plain NULL::integer, so "c0 <> 7" is NULL for every row and
nothing should survive it. EXPLAIN (VERBOSE, COSTS OFF) shows that the
filter is simply gone:

Result
Output: 0, '0'::bigint
-> Append
-> Result
One-Time Filter: (now() IS NOT NULL)
-> Result
One-Time Filter: (now() IS NOT NULL)

Bisection points to commit f2bae51dfd5 ("Keep track of what RTIs a Result
node is scanning", 2025-09-23).

Best regards,
Viktor Leis

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2026-07-25 07:24:18 BUG #19580: Can not FINALIZE detach partition. Table in stuck
Previous Message Nitin Motiani 2026-07-24 16:50:12 Re: BUG #19560: Wrong results since v16: removable LEFT JOIN silently drops WHERE qual