model-writtenrun 2424 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Olleg Samoylov reported that opening a PL/pgSQL cursor over a simple SELECT worked normally but failed with an unexpected-plan-node error when SCROLL was specified #1.
- Andrei Lepikhov traced the failure to the planner adding a Material node that exec_save_simple_expr() could not handle, and Tom Lane agreed that the function should look through Material as it already did Gather #2 #3.
- Andrei Lepikhov submitted a patch adding a separate Material-handling branch and a regression test that opened a scrollable cursor over SELECT NULL #4.
- Richard Guo pointed out that setrefs.c could copy a Const into Material's target list and proposed sharing Gather's existing handling to account for that case #5.
- Tom Lane committed the patch with shared Gather/Material processing, revised commentary, and a relocated regression test that fetched and reported a value, then announced the push 0f60e1fba1 #6.
- Tom Lane closed the discussion by confirming that he had independently reached Richard Guo's conclusion before seeing his review; the fix had landed with no remaining work identified #7.