Re: BUG #19931: postgres_fdw: FOR UPDATE over a pushed-down join ignores a pseudoconstant qual

From: Nitin Motiani <nitinmotiani(at)google(dot)com>
To: tharakan(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: etsuro(dot)fujita(at)gmail(dot)com, Richard Guo <guofenglinux(at)gmail(dot)com>
Subject: Re: BUG #19931: postgres_fdw: FOR UPDATE over a pushed-down join ignores a pseudoconstant qual
Date: 2026-11-23 11:40:04
Message-ID: CAH5HC97G3Fd_j40nYvh-t1wJVGn=YWbUxwtBm9+DCmveo4LUGA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Nov 23, 2026 at 2:10 PM PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
>
> It returns the wrong rows on master (9b5d4e33317) through REL_17_STABLE.
> REL_16_STABLE and older return no rows: 6f80a8d9c13, back-patched to
> them, stopped FDWs from replacing a join that has pseudoconstant quals,
> and 9e9931d2bf4, on master only, allowed it again.
>

Thanks for the report. I was able to reproduce this bug. The fix seems
small so I'm attaching a patch. It fixes this issue by passing
fdw_restrictinfo of the join path to the final path which can then use
it to gate on the clauses like now() is null.

Please take a look.

Thanks & Regards,
Nitin Motiani
Google

Attachment Content-Type Size
v1-0001-postgres_fdw-Fix-FOR-UPDATE-SHARE-over-a-join-ign.patch application/x-patch 8.4 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Jesper St John 2026-11-23 11:50:19 Re: Timing issue in pg_basebackup
Previous Message Shlok Kyal 2026-11-23 10:00:47 Re: Logical replication commits duplicates in DEFERRABLE unique indexes