Several Build errors while building jdbc2_fdw for postgres by heimir-sverrisson

246 views Asked by At

I am installing jdbc2_fdw extension for PostgreSQL 9.6 ( Have tried with PostgreSQL 12, didn't work). I am using the command sudo PATH=/usr/lib/postgresql/9.6/bin/:$PATH make USE_PGXS=1install to compile and build. I am getting a bunch of errors and the same has been listed. Java, JavaC & postgres versions are listed below. Please Help.

user@friday:~/Downloads/jdbc/jdbc2_fdw$ java --version
openjdk 11.0.9.1 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)
user@friday:~/Downloads/jdbc/jdbc2_fdw$ javac --version
javac 11.0.9.1

Postgres version

 PostgreSQL 9.6.20 on x86_64-pc-linux-gnu (Ubuntu 9.6.20-1.pgdg20.04+1), compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit
(1 row)
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -D'PKG_LIB_DIR=/usr/lib/postgresql/9.6/lib' -I/usr/include/postgresql -I. -I./ -I/usr/include/postgresql/9.6/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o jdbc2_fdw.o jdbc2_fdw.c
jdbc2_fdw.c: In function ‘jdbc2_fdw_handler’:
jdbc2_fdw.c:353:29: warning: assignment to ‘GetForeignPlan_function’ {aka ‘struct ForeignScan * (*)(struct PlannerInfo *, struct RelOptInfo *, unsigned int,  struct ForeignPath *, struct List *, struct List *, struct Plan *)’} from incompatible pointer type ‘ForeignScan * (*)(PlannerInfo *, RelOptInfo *, Oid,  ForeignPath *, List *, List *)’ {aka ‘struct ForeignScan * (*)(struct PlannerInfo *, struct RelOptInfo *, unsigned int,  struct ForeignPath *, struct List *, struct List *)’} [-Wincompatible-pointer-types]
  353 |     routine->GetForeignPlan = jdbcGetForeignPlan;
      |                             ^
jdbc2_fdw.c: In function ‘jdbcGetForeignRelSize’:
jdbc2_fdw.c:469:38: error: ‘RelOptInfo’ {aka ‘struct RelOptInfo’} has no member named ‘reltargetlist’; did you mean ‘reltarget’?
  469 |     pull_varattnos((Node *) baserel->reltargetlist, baserel->relid,
      |                                      ^~~~~~~~~~~~~
      |                                      reltarget
jdbc2_fdw.c:512:16: error: ‘RelOptInfo’ {aka ‘struct RelOptInfo’} has no member named ‘width’
  512 |         baserel->width = fpinfo->width;
      |                ^~
jdbc2_fdw.c:529:41: error: ‘RelOptInfo’ {aka ‘struct RelOptInfo’} has no member named ‘width’
  529 |                 (10 * BLCKSZ) / (baserel->width + sizeof(HeapTupleHeaderData));
      |                                         ^~
jdbc2_fdw.c: In function ‘jdbcGetForeignPaths’:
jdbc2_fdw.c:553:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  553 |  PgFdwRelationInfo *fpinfo = (PgFdwRelationInfo *) baserel->fdw_private;
      |  ^~~~~~~~~~~~~~~~~
jdbc2_fdw.c:564:42: error: incompatible type for argument 3 of ‘create_foreignscan_path’
  564 |                                    fpinfo->rows,
      |                                    ~~~~~~^~~~~~
      |                                          |
      |                                          double
In file included from jdbc2_fdw.c:28:
/usr/include/postgresql/9.6/server/optimizer/pathnode.h:90:21: note: expected ‘PathTarget *’ {aka ‘struct PathTarget *’} but argument is of type ‘double’
   90 | extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/postgresql/9.6/server/nodes/primnodes.h:21,
                 from /usr/include/postgresql/9.6/server/nodes/parsenodes.h:25,
                 from /usr/include/postgresql/9.6/server/foreign/foreign.h:16,
                 from jdbc2_fdw.h:16,
                 from jdbc2_fdw.c:15:
/usr/include/postgresql/9.6/server/nodes/pg_list.h:69:19: error: incompatible type for argument 6 of ‘create_foreignscan_path’
   69 | #define NIL      ((List *) NULL)
      |                  ~^~~~~~~~~~~~~~
      |                   |
      |                   List * {aka struct List *}
jdbc2_fdw.c:567:36: note: in expansion of macro ‘NIL’
  567 |                                    NIL, /* no pathkeys */
      |                                    ^~~
In file included from jdbc2_fdw.c:28:
/usr/include/postgresql/9.6/server/optimizer/pathnode.h:90:21: note: expected ‘Cost’ {aka ‘double’} but argument is of type ‘List *’ {aka ‘struct List *’}
   90 | extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/postgresql/9.6/server/nodes/primnodes.h:21,
                 from /usr/include/postgresql/9.6/server/nodes/parsenodes.h:25,
                 from /usr/include/postgresql/9.6/server/foreign/foreign.h:16,
                 from jdbc2_fdw.h:16,
                 from jdbc2_fdw.c:15:
/usr/include/postgresql/9.6/server/nodes/pg_list.h:69:19: warning: passing argument 8 of ‘create_foreignscan_path’ from incompatible pointer type [-Wincompatible-pointer-types]
   69 | #define NIL      ((List *) NULL)
      |                  ~^~~~~~~~~~~~~~
      |                   |
      |                   List * {aka struct List *}
jdbc2_fdw.c:569:36: note: in expansion of macro ‘NIL’
  569 |                                    NIL);        /* no fdw_private list */
      |                                    ^~~
In file included from jdbc2_fdw.c:28:
/usr/include/postgresql/9.6/server/optimizer/pathnode.h:90:21: note: expected ‘Relids’ {aka ‘struct Bitmapset *’} but argument is of type ‘List *’ {aka ‘struct List *’}
   90 | extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
jdbc2_fdw.c:563:12: error: too few arguments to function ‘create_foreignscan_path’
  563 |     path = create_foreignscan_path(root, baserel,
      |            ^~~~~~~~~~~~~~~~~~~~~~~
In file included from jdbc2_fdw.c:28:
/usr/include/postgresql/9.6/server/optimizer/pathnode.h:90:21: note: declared here
   90 | extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
jdbc2_fdw.c: In function ‘jdbcGetForeignPlan’:
jdbc2_fdw.c:591:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  591 |     PgFdwRelationInfo *fpinfo = (PgFdwRelationInfo *) baserel->fdw_private;
      |     ^~~~~~~~~~~~~~~~~
jdbc2_fdw.c:685:13: warning: enumeration value ‘LCS_NONE’ not handled in switch [-Wswitch]
  685 |             switch (rc->strength)
      |             ^~~~~~
jdbc2_fdw.c:715:12: error: too few arguments to function ‘make_foreignscan’
  715 |     return make_foreignscan(tlist,
      |            ^~~~~~~~~~~~~~~~
In file included from jdbc2_fdw.c:30:
/usr/include/postgresql/9.6/server/optimizer/planmain.h:51:21: note: declared here
   51 | extern ForeignScan *make_foreignscan(List *qptlist, List *qpqual,
      |                     ^~~~~~~~~~~~~~~~
jdbc2_fdw.c: In function ‘jdbcBeginForeignScan’:
jdbc2_fdw.c:740:11: warning: unused variable ‘new_query’ [-Wunused-variable]
  740 |     char *new_query;
      |           ^~~~~~~~~
jdbc2_fdw.c: In function ‘jdbcIterateForeignScan’:
jdbc2_fdw.c:850:21: warning: variable ‘slot’ set but not used [-Wunused-but-set-variable]
  850 |     TupleTableSlot *slot;
      |                     ^~~~
jdbc2_fdw.c: In function ‘postgresReScanForeignScan’:
jdbc2_fdw.c:864:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  864 |  PgFdwScanState *fsstate = (PgFdwScanState *) node->fdw_state;
      |  ^~~~~~~~~~~~~~
jdbc2_fdw.c: In function ‘postgresEndForeignScan’:
jdbc2_fdw.c:921:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  921 |     PgFdwScanState *fsstate = (PgFdwScanState *) node->fdw_state;
      |     ^~~~~~~~~~~~~~
jdbc2_fdw.c: In function ‘postgresPlanForeignModify’:
jdbc2_fdw.c:1030:42: error: ‘RangeTblEntry’ {aka ‘struct RangeTblEntry’} has no member named ‘modifiedCols’
 1030 |         Bitmapset  *tmpset = bms_copy(rte->modifiedCols);
      |                                          ^~
jdbc2_fdw.c: In function ‘estimate_path_cost_size’:
jdbc2_fdw.c:1618:24: error: ‘RelOptInfo’ {aka ‘struct RelOptInfo’} has no member named ‘width’
 1618 |         width = baserel->width;
      |                        ^~
jdbc2_fdw.c: In function ‘set_transmission_modes’:
jdbc2_fdw.c:1939:16: error: too few arguments to function ‘set_config_option’
 1939 |         (void) set_config_option("datestyle", "ISO",
      |                ^~~~~~~~~~~~~~~~~
In file included from jdbc2_fdw.c:36:
/usr/include/postgresql/9.6/server/utils/guc.h:366:12: note: declared here
  366 | extern int set_config_option(const char *name, const char *value,
      |            ^~~~~~~~~~~~~~~~~
jdbc2_fdw.c:1943:16: error: too few arguments to function ‘set_config_option’
 1943 |         (void) set_config_option("intervalstyle", "postgres",
      |                ^~~~~~~~~~~~~~~~~
In file included from jdbc2_fdw.c:36:
/usr/include/postgresql/9.6/server/utils/guc.h:366:12: note: declared here
  366 | extern int set_config_option(const char *name, const char *value,
      |            ^~~~~~~~~~~~~~~~~
jdbc2_fdw.c:1947:16: error: too few arguments to function ‘set_config_option’
 1947 |         (void) set_config_option("extra_float_digits", "3",
      |                ^~~~~~~~~~~~~~~~~
In file included from jdbc2_fdw.c:36:
/usr/include/postgresql/9.6/server/utils/guc.h:366:12: note: declared here
  366 | extern int set_config_option(const char *name, const char *value,
      |            ^~~~~~~~~~~~~~~~~
jdbc2_fdw.c: In function ‘jdbcGetForeignPlan’:
jdbc2_fdw.c:720:1: warning: control reaches end of non-void function [-Wreturn-type]
  720 | }
      | ^
At top level:
jdbc2_fdw.c:1839:1: warning: ‘fetch_more_data’ defined but not used [-Wunused-function]
 1839 | fetch_more_data(ForeignScanState *node)
      | ^~~~~~~~~~~~~~~
jdbc2_fdw.c:1747:1: warning: ‘create_cursor’ defined but not used [-Wunused-function]
 1747 | create_cursor(ForeignScanState *node)
      | ^~~~~~~~~~~~~
jdbc2_fdw.c:1718:1: warning: ‘ec_member_matches_foreign’ defined but not used [-Wunused-function]
 1718 | ec_member_matches_foreign(PlannerInfo *root, RelOptInfo *rel,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [<builtin>: jdbc2_fdw.o] Error 1
1

There are 1 answers

1
Laurenz Albe On

It looks like the software is not compatible with that PostgreSQL version. You should contact the maintainers. If they won't assist you, you could pay a PostgreSQL hacker to adapt the code.

I wouldn't use an old version like 9.6.