Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
This PR is to add state reset code when begin a scan, this can partially fix #237.
What is the current behavior?
The foreign table scan execution plan will be cached when foreign table query is defined in a function, this will result in
begin_scan()
being called without callingnew()
function, which is supposed to re-initialise the FDW instance.What is the new behavior?
Added some state reseting codes in
begin_scan()
for some FDWs, so that their inner state will be reset correctly.Additional context
This PR can partially fix #237, so the continuous foreign table function call should be correct. But for permanent fix, we need to find out better way to manage and re-use
FdwState
.