sqlite_fdw icon indicating copy to clipboard operation
sqlite_fdw copied to clipboard

PostgreSQL 17 support

Open devrimgunduz opened this issue 1 year ago • 3 comments

Hi,

2.4.0 fails to build against PostgreSQL 17. v17 beta2 is already out. Can you please take a look?

Thanks, Devrim

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 -g -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -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 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -fvisibility=hidden -I. -I./ -I/usr/pgsql-17/include/server -I/usr/pgsql-17/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -DWITH_GZFILEOP -I/usr/include -c -o sqlite_fdw.o sqlite_fdw.c sqlite_fdw.c: In function ‘sqlite_add_paths_with_pathkeys_for_rel’: sqlite_fdw.c:832:42: error: too few arguments to function ‘create_foreignscan_path’ 832 | create_foreignscan_path(root, rel, | ^~~~~~~~~~~~~~~~~~~~~~~ In file included from sqlite_fdw.c:24: /usr/pgsql-17/include/server/optimizer/pathnode.h:125:21: note: declared here 125 | extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel, | ^~~~~~~~~~~~~~~~~~~~~~~ sqlite_fdw.c:848:42: error: too few arguments to function ‘create_foreign_join_path’ 848 | create_foreign_join_path(root, rel, | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/pgsql-17/include/server/optimizer/pathnode.h:133:21: note: declared here 133 | extern ForeignPath *create_foreign_join_path(PlannerInfo *root, RelOptInfo *rel, | ^~~~~~~~~~~~~~~~~~~~~~~~ sqlite_fdw.c: In function ‘sqliteGetForeignPaths’: sqlite_fdw.c:944:26: error: too few arguments to function ‘create_foreignscan_path’ 944 | create_foreignscan_path(root, baserel, | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/pgsql-17/include/server/optimizer/pathnode.h:125:21: note: declared here 125 | extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel, | ^~~~~~~~~~~~~~~~~~~~~~~ sqlite_fdw.c:1116:33: warning: declaration of ‘startup_cost’ shadows a previous local [-Wshadow=compatible-local] 1116 | Cost startup_cost; | ^~~~~~~~~~~~ sqlite_fdw.c:918:25: note: shadowed declaration is here 918 | Cost startup_cost = 10; | ^~~~~~~~~~~~ sqlite_fdw.c:1117:33: warning: declaration of ‘total_cost’ shadows a previous local [-Wshadow=compatible-local] 1117 | Cost total_cost; | ^~~~~~~~~~ sqlite_fdw.c:919:25: note: shadowed declaration is here 919 | Cost total_cost = baserel->rows + startup_cost; | ^~~~~~~~~~ sqlite_fdw.c:1132:24: error: too few arguments to function ‘create_foreignscan_path’ 1132 | path = create_foreignscan_path(root, baserel, | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/pgsql-17/include/server/optimizer/pathnode.h:125:21: note: declared here 125 | extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel, | ^~~~~~~~~~~~~~~~~~~~~~~ sqlite_fdw.c: In function ‘sqliteImportForeignSchema’: sqlite_fdw.c:3157:57: warning: declaration of ‘rc’ shadows a previous local [-Wshadow=compatible-local] 3157 | int rc = sqlite3_step(pragma_stmt); | ^~ sqlite_fdw.c:3127:49: note: shadowed declaration is here 3127 | int rc = sqlite3_step(sql_stmt); | ^~ sqlite_fdw.c: In function ‘sqliteGetForeignJoinPaths’: sqlite_fdw.c:3689:20: error: too few arguments to function ‘create_foreign_join_path’ 3689 | joinpath = create_foreign_join_path(root, | ^~~~~~~~~~~~~~~~~~~~~~~~ /usr/pgsql-17/include/server/optimizer/pathnode.h:133:21: note: declared here 133 | extern ForeignPath *create_foreign_join_path(PlannerInfo *root, RelOptInfo *rel, | ^~~~~~~~~~~~~~~~~~~~~~~~ sqlite_fdw.c: In function ‘sqlite_foreign_grouping_ok’: sqlite_fdw.c:3946:29: warning: declaration of ‘aggvars’ shadows a previous local [-Wshadow=compatible-local] 3946 | List *aggvars = NIL; | ^~~~~~~ sqlite_fdw.c:3770:21: note: shadowed declaration is here 3770 | List *aggvars; | ^~~~~~~ sqlite_fdw.c: In function ‘sqlite_add_foreign_grouping_paths’: sqlite_fdw.c:4139:21: error: too few arguments to function ‘create_foreign_upper_path’ 4139 | grouppath = create_foreign_upper_path(root, | ^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/pgsql-17/include/server/optimizer/pathnode.h:141:21: note: declared here 141 | extern ForeignPath *create_foreign_upper_path(PlannerInfo *root, RelOptInfo *rel, | ^~~~~~~~~~~~~~~~~~~~~~~~~ sqlite_fdw.c: In function ‘sqlite_add_foreign_ordered_paths’: sqlite_fdw.c:4297:24: error: too few arguments to function ‘create_foreign_upper_path’ 4297 | ordered_path = create_foreign_upper_path(root, | ^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/pgsql-17/include/server/optimizer/pathnode.h:141:21: note: declared here 141 | extern ForeignPath *create_foreign_upper_path(PlannerInfo *root, RelOptInfo *rel, | ^~~~~~~~~~~~~~~~~~~~~~~~~ sqlite_fdw.c: In function ‘sqlite_add_foreign_final_paths’: sqlite_fdw.c:4501:22: error: too few arguments to function ‘create_foreign_upper_path’ 4501 | final_path = create_foreign_upper_path(root, | ^~~~~~~~~~~~~~~~~~~~~~~~~ /usr/pgsql-17/include/server/optimizer/pathnode.h:141:21: note: declared here 141 | extern ForeignPath *create_foreign_upper_path(PlannerInfo *root, RelOptInfo *rel, | ^~~~~~~~~~~~~~~~~~~~~~~~~

devrimgunduz avatar Jul 29 '24 15:07 devrimgunduz

Hi,

This patch for tds_fdw can give you an idea about how to fix it:

https://github.com/tds-fdw/tds_fdw/pull/358/commits/2921bd79d1b174050ff70c046a3d7013031b8c25

devrimgunduz avatar Aug 12 '24 08:08 devrimgunduz

Attached patch fixes the problem. Can you please review?

sqlite_fdw-pg17.patch.txt

devrimgunduz avatar Sep 23 '24 17:09 devrimgunduz

@devrimgunduz Thank you for your report. We have already started for supporting PostgreSQL 17 using its on beta version and it works fine but the source code is not published yet. We are planning to release new SQLite FDW soon after PostgreSQL 17.0 was released and tested SQLite FDW on the new PostgreSQL.

t-kataym avatar Sep 26 '24 04:09 t-kataym

@t-kataym any updates? there is already 17.2 is available. I've compiled sqlite_fdw with latest postgres 16.6 version. but couldn't do this for 17th one.

AmebaBrain avatar Dec 01 '24 01:12 AmebaBrain

@AmebaBrain , now for this FDW there are such works as

  • adaptation to PostgreSQL 17 in private draft branch of pgspider team,
  • MAC support which is reviewed and approved,
  • GIS support where there is unexpected encapsulated in C++ libproj memory allocation problem on RockyLinux 8.

As I have understood, complex of this merged changes will be a new release. Maybe plans of pgspider team will changes, because I have no actual @t-kataym 's opinion about this.

mkgrgis avatar Dec 02 '24 06:12 mkgrgis

@AmebaBrain I have released a new version of SQLite FDW supporting PostgreSQL 17.

t-kataym avatar Dec 10 '24 04:12 t-kataym

@t-kataym I've created docker image with postgres 17.2 and this new release. Available on docker hub. Also updated FDW specification for this new 2.5.0 release as well.

Many thanks for the release!

AmebaBrain avatar Dec 10 '24 23:12 AmebaBrain

@AmebaBrain Thank you for your information.

t-kataym avatar Dec 12 '24 04:12 t-kataym