Re: Two bugs in reconsider_full_join_clause(), handling coalesce() = const clauses

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Two bugs in reconsider_full_join_clause(), handling coalesce() = const clauses
Date: 2026-11-11 19:11:07
Message-ID: 06913a5a-f189-4615-8274-d1fcec726265@vondra.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/11/26 19:49, Kirill Reshke wrote:
> ...
>
> Hi!
> Cool findings.
>
> There is another issue I found during review, but this issue is not
> directly related (exist on master before and after
> e50d958f092bc33fcb51089c68c72779bae2a6a3), and maybe should be fixed
> as separate bugs.But I decided to report here
>
> example setup & query
>
> CREATE TABLE fj_left (x int);
> CREATE TABLE fj_right (x int);
> INSERT INTO fj_left VALUES (0);
> INSERT INTO fj_right VALUES (1);
>
> SELECT a.x AS ax, b.x AS bx
> FROM fj_left a FULL JOIN fj_right b ON concat(a.x) = b.x::text
> WHERE coalesce(concat(a.x), b.x::text) = '';
>
> (zero rows)
>

Isn't this the same issue as
https://www.postgresql.org/message-id/0074fbf7-a92c-417a-937a-6b1fc27aed82@vondra.me
?

The fix I posted in that thread is a bit more elaborate, but also uses
contain_nonstrict_functions. Please take a look and check if my fix
addresses this issue, and whether it's correct.

regards

--
Tomas Vondra

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-11-11 19:18:04 Re: [PATCH] psql: reject invalid \watch intervals before timer conversion
Previous Message Matheus Alcantara 2026-11-11 18:54:24 Re: extension_control_path: ignore empty elements and deduplicate directories