Skip to content

Compatibility Issue When Compiling jdbc_fdw with PostgreSQL 17 RHEL9 #45

@javierordonezojeda

Description

@javierordonezojeda

Hello,
I am encountering several compilation errors when trying to build the jdbc_fdw extension with PostgreSQL 17. It seems that some functions and APIs used in the code have been deprecated or modified in this PostgreSQL version.

Below are some of the key error messages observed during the build process:

# make USE_PGXS=1
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -fvisibility=hidden -D'PKG_LIB_DIR=/usr/pgsql-17/lib' -I/usr/pgsql-17/include -I. -I./ -I/usr/pgsql-17/include/server -I/usr/pgsql-17/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o jdbc_fdw.o jdbc_fdw.c
jdbc_fdw.c: In function ‘jdbc_exec’:
jdbc_fdw.c:471:17: warning: implicit declaration of function ‘tuplestore_donestoring’; did you mean ‘tuplestore_rescan’? [-Wimplicit-function-declaration]
  471 |                 tuplestore_donestoring((ReturnSetInfo *) fcinfo->resultinfo->setResult);
      |                 ^~~~~~~~~~~~~~~~~~~~~~
      |                 tuplestore_rescan
jdbc_fdw.c:471:76: error: ‘struct Node’ has no member named ‘setResult’
  471 |  tuplestore_donestoring((ReturnSetInfo *) fcinfo->resultinfo->setResult);
      |                                                             ^~

jdbc_fdw.c: In function ‘jdbcGetForeignPaths’:
jdbc_fdw.c:783:26: error: too few arguments to function ‘create_foreignscan_path’
  783 |                          create_foreignscan_path(root, baserel,
      |                          ^~~~~~~~~~~~~~~~~~~~~~~
In file included from jdbc_fdw.c:37:
/usr/pgsql-17/include/server/optimizer/pathnode.h:125:21: note: declared here
  125 | extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~
jdbc_fdw.c: In function ‘jdbcReScanForeignScan’:
jdbc_fdw.c:1338:62: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
 1338 |         if (!fsstate->cursor_exists || !fsstate->resultSetID > 0)
      |                                                              ^
jdbc_fdw.c:1338:40: note: add parentheses around left hand side expression to silence this warning
 1338 |         if (!fsstate->cursor_exists || !fsstate->resultSetID > 0)
      |                                        ^~~~~~~~~~~~~~~~~~~~~
      |                                        (                    )
jdbc_fdw.c: In function ‘jdbc_add_foreign_grouping_paths’:
jdbc_fdw.c:2389:21: error: too few arguments to function ‘create_foreign_upper_path’
 2389 |         grouppath = create_foreign_upper_path(root,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from jdbc_fdw.c:37:
/usr/pgsql-17/include/server/optimizer/pathnode.h:141:21: note: declared here
  141 | extern ForeignPath *create_foreign_upper_path(PlannerInfo *root, RelOptInfo *rel,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
jdbc_fdw.c: In function ‘jdbc_add_foreign_final_paths’:
jdbc_fdw.c:2531:46: error: too few arguments to function ‘create_foreign_upper_path’
 2531 |                                 final_path = create_foreign_upper_path(root,
      |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from jdbc_fdw.c:37:
/usr/pgsql-17/include/server/optimizer/pathnode.h:141:21: note: declared here
  141 | extern ForeignPath *create_foreign_upper_path(PlannerInfo *root, RelOptInfo *rel,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
jdbc_fdw.c:2658:22: error: too few arguments to function ‘create_foreign_upper_path’
 2658 |         final_path = create_foreign_upper_path(root,
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from jdbc_fdw.c:37:
/usr/pgsql-17/include/server/optimizer/pathnode.h:141:21: note: declared here
  141 | extern ForeignPath *create_foreign_upper_path(PlannerInfo *root, RelOptInfo *rel,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [<builtin>: jdbc_fdw.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions