On Wed, Dec 17, 2025 at 9:09 AM Alexander Pyhalov <[email protected]> wrote: > I've looked at this patch, because also was playing with tuplestore in > PgFdwScanState to have more predictable memory usage with large > fetch_size. Unfortunately, I've found that you can't use > TTSOpsMinimalTuple(?) tuplestore to store tuple's ctid. I hoped this > patch provides some solution for this issue, but no, it seems have the > same problem. Attaching test case with a reproducer.
Rafia, the bug that Alexander reports here is still unfixed in the latest version of the patch. In short, tuplestore_puttuple() doesn't store the CTID. A standalone, Claude-written test case demonstrating the problem is attached. One possible way to fix this is to disable streaming_fetch when CTID is among the columns fetched. If the CTID is being fetched because we're doing an UPDATE or DELETE, the scan is going to have to be drained to allow the per-row UPDATE or DELETE commands to be executed, so streaming-fetch mode is actually a bad idea anyway. -- Robert Haas Databricks
streaming_fetch_ctid.sql
Description: Binary data
