Re: reconsider_full_join_clause fails to consider if COALESCE() arguments are NULL-preserving

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: reconsider_full_join_clause fails to consider if COALESCE() arguments are NULL-preserving
Date: 2026-11-11 21:47:46
Message-ID: e185f00a-f4fc-4bfe-b422-53e2d15871be@vondra.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Here's a rebased version of the patch(es). I've made no change to the
code itself, I've tried to improve the commit message to explain why the
expressions need to be null-preserving, handling of COALESCE clauses and
placeholders.

Initially I've planned to backpatch to 16, as I assumed this was likely
introduced by the JoinDomain improvements in that release. But it seems
it's actually much older, possibly even going all the way back to 8.1
(but I haven't tried to build that).

All I know is that the regression tests give incorrect results on 15
(without the code fix).

regards

--
Tomas Vondra

Attachment Content-Type Size
v2-15-0001-Fix-FULL-JOIN-constant-propagation-with-non-st.patch text/x-patch 10.0 KB
v2-master-0001-Fix-FULL-JOIN-constant-propagation-with-no.patch text/x-patch 9.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-11-11 21:51:18 Re: Autovacuum freeze scores wrap around for just-vacuumed tables
Previous Message Bharath Rupireddy 2026-11-11 21:33:40 Re: Parallel heap vacuum