Re: postgres_fdw: semi-join pushdown generates invalid remote SQL ("missing FROM-clause entry") with a nested correlated subquery

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: kelly(at)nplan(dot)io
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, rafia(dot)pghackers(at)gmail(dot)com
Subject: Re: postgres_fdw: semi-join pushdown generates invalid remote SQL ("missing FROM-clause entry") with a nested correlated subquery
Date: 2026-12-04 04:17:54
Message-ID: CAGRkXqQK+ab=JU6kEQi00taY5YcwE3KY-o8sAXO87kn-WDfpxQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Kelly,

> ERROR: missing FROM-clause entry for table "r2"

I can reproduce this on master. Rafia posted a patch for the same
error [1], and it fixes your queries for me.

Rafia, the nested EXISTS case here may be worth adding to your test.

[1]
https://www.postgresql.org/message-id/CA+FpmFdQ9P4EgMSkAJh29e744TxzBpkOOSfy1Cxoco-ZK3zbvQ@mail.gmail.com

Thanks,
Shihao

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message shihao zhong 2026-12-04 04:18:25 Re: BUG #19937: Assertion failure (SIGABRT) in GiST KNN scan (computeDistance) on box with NaN coordinate
Previous Message shihao zhong 2026-12-04 04:17:07 Re: Cached plan can stay stale indefinitely when an invalidation for a planner-added dependency arrives during planning