Fix rescan support for external scan nodes.
Instead of pushing the responsibility of rescanning down to each different kind of external table implement rescanning in fileam.c in a generic fashion, by closing and reopening the underlying "url". This gets us rescan support for custom and EXECUTE-type external tables, which was missing before, and also makes the code simpler. There are no known cases where the rescan support is currently needed (hence no test case included), because the planner puts Materialize nodes on top of external scans, but in principle every plan node is supposed to be rescannable. I tested this by reverting the previous patch that fixed using external scans in a subplan; without that patch, an external table in a subplan would get rescanned.
Showing
想要评论请 注册 或 登录