Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support PostgreSQL 14 #272

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

df7cb
Copy link
Contributor

@df7cb df7cb commented Nov 25, 2021

There are issues that need resolving, see the last commit message.

df7cb and others added 2 commits August 18, 2020 15:56
PG14 reworked the FDW interface. This patch is an incomplete attempt to
follow the changes.

TODO:
* multicornBeginForeignScan:
  extractRestrictions needs access to PlannerInfo *root
* multicornBeginForeignModify:
  This diff needs verification:
-	PlanState  *ps = mtstate->mt_plans[subplan_index];
+	PlanState  *ps =
+#if PG_VERSION_NUM >= 140000
+		outerPlanState(mtstate);
@df7cb df7cb mentioned this pull request Nov 25, 2021
@galuszkak
Copy link
Collaborator

Hi @df7cb,

I've got last week permissions to merge in this repository, and will review it today/tomorrow.

I've merged CI/CD and Windows build yesterday. It still has some small issues, that I need to fix there, and then will look into Your PR.

@ShaheedHaque
Copy link

@df7cb I'd like to try to help you get this unblocked. Looking first at the issue with multicornBeginForeignScan, am I right in thinking the problem is that you need to have access to the PlannerInfo *root to address this FIXME?

extractRestrictions(NULL, /* FIXME: set this properly. Parameter is used on PG14+ only, we can use NULL on older versions */

Assuming that is correct, I see this clue from the PG14 docs on BeginForeignScan:

Information about the table to scan is accessible through the ForeignScanState node (in particular, from the underlying ForeignScan plan node, which contains any FDW-private information provided by GetForeignPlan)

So, although multicornBeginForeignScan does not have an argument for the PlannerInfo, it might be possible to pass one down via the multicornGetForeignPlan using the fscan->fdw_private mechanism.

(I'm not familiar with the List logic used by serializePlanState to set up the fdw_private stuff, so I'll pause here to see if this is heading in the direction you want before going further).

@df7cb
Copy link
Contributor Author

df7cb commented Mar 4, 2022

@ShaheedHaque: I have no plans to work on this. If you are interested in getting it fixed, please don't hesitate do jump ahead.

@ShaheedHaque
Copy link

OK. I did chase things down a bit, and it seems that there is no way for the PlannerInfo to be serialised into the List (by [copyObject](https://doxygen.postgresql.org/nodes_8h.html#a7a94d766e81e5266639fb091a912590c)), so that idea won't work. Somehow then, the use of root in extractRestriction would need to be sidestepped. That needs a much deeper level of understanding than I have at this time.

@denishpatel
Copy link

@df7cb @ShaheedHaque I'm facing same issue to build it with pg14. anyone of you got success building package with pg14?

@ShaheedHaque
Copy link

ShaheedHaque commented Mar 22, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants