ostinru commented on code in PR #31:
URL: https://github.com/apache/cloudberry-pxf/pull/31#discussion_r2726563448


##########
fdw/pxf_fdw.c:
##########
@@ -920,36 +946,81 @@ InitCopyStateForModify(PxfFdwModifyState *pxfmstate)
 /*
  * Set up CopyState for writing to a foreign table.
  */
+#if (PG_VERSION_NUM < 140000)
 static CopyState
 BeginCopyTo(Relation forrel, List *options)
+#else
+static CopyToState
+BeginCopyToModify(Relation forrel, List *options)
+#endif
 {
+#if PG_VERSION_NUM < 140000
        CopyState       cstate;
+#else
+       CopyToState     cstate;
+#endif
 
        Assert(forrel->rd_rel->relkind == RELKIND_FOREIGN_TABLE);
 
-       cstate = BeginCopyToForeignTable(forrel, options);
+#if PG_VERSION_NUM <= 90500
+       cstate = BeginCopy(false, forrel, NULL, NULL, NIL, options, NULL);
+#elif PG_VERSION_NUM < 120000
+       cstate = BeginCopy(false, forrel, NULL, NULL, forrel->rd_id, NIL, 
options, NULL);
+#elif PG_VERSION_NUM < 140000
+       cstate = BeginCopy(NULL, false, forrel, NULL, forrel->rd_id, NIL, 
options, NULL);
+#else
+       cstate = BeginCopy(NULL, forrel, NULL, forrel->rd_id, NIL, options, 
NULL);
+#endif
        cstate->dispatch_mode = COPY_DIRECT;
 
        /*
         * We use COPY_CALLBACK to mean that the each line should be left in
         * fe_msgbuf. There is no actual callback!
         */
+#if (PG_VERSION_NUM < 140000)
+       cstate->copy_dest = COPY_CALLBACK;
+#else
        cstate->copy_dest = COPY_CALLBACK;
+#endif

Review Comment:
   No difference in branches - probably, it can be eliminated.



##########
fdw/pxf_filter.c:
##########
@@ -178,7 +178,7 @@ dbop_pxfop_map pxf_supported_opr_op_expr[] =
        {85 /* boolne */ , PXFOP_NE},
 
        /* bpchar */
-       {BPCharEqualOperator /* bpchareq */ , PXFOP_EQ},
+       {BpcharEqualOperator /* bpchareq */ , PXFOP_EQ},

Review Comment:
   I guess (and not sure) that this change will not compile for all PostgreSQL 
versions before 13.0.
   
   Then, it seems reasonable to drop support of all PostgreSQL before 14.0.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to