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

Support PostgreSQL 17 #142

Open
wscherphof opened this issue Dec 18, 2024 · 1 comment
Open

Support PostgreSQL 17 #142

wscherphof opened this issue Dec 18, 2024 · 1 comment

Comments

@wscherphof
Copy link

Context

Compiling the project in a PostgreSQL 17 context.

Steps to Reproduce

  1. FROM postgis/postgis:17-3.5 # Debian Bullseye
  2. RUN apt update
  3. RUN apt install -y build-essential postgresql-server-dev-17 unixodbc-dev
  4. ADD src/odbc_fdw-0.5.2.3.tar.gz /
  5. RUN cd /odbc_fdw-0.5.2.3; make; make install

Current Result

1.211 odbc_fdw.c: In function ‘odbcGetForeignPaths’:
1.211 odbc_fdw.c:1350:20: error: too few arguments to function ‘create_foreignscan_path’
1.211  1350 |           (Path *) create_foreignscan_path(root, baserel,
1.211       |                    ^~~~~~~~~~~~~~~~~~~~~~~
1.211 In file included from odbc_fdw.c:50:
1.211 /usr/include/postgresql/17/server/optimizer/pathnode.h:125:21: note: declared here
1.211   125 | extern ForeignPath *create_foreignscan_path(PlannerInfo *root, RelOptInfo *rel,
1.211       |                     ^~~~~~~~~~~~~~~~~~~~~~~
1.235 make: *** [<builtin>: odbc_fdw.o] Error 1

Expected result

No errors.

System trying to connect to and version

Not applicable.

Additional info

Not applicable.

@JBHighHair
Copy link

JBHighHair commented Dec 19, 2024

The parameter fdw_restrictinfo was added in PG17 for function create_foreignscan_path...

	add_path(baserel,
	         (Path *) create_foreignscan_path(root, baserel,
#if PG_VERSION_NUM >= 90600
	                 NULL, /* PathTarget */
#endif
	                 baserel->rows,
	                 startup_cost,
	                 total_cost,
	                 NIL, /* no pathkeys */
	                 NULL, /* no outer rel either */
	                 NULL, /* no extra plan */
#if PG_VERSION_NUM >= 170000
	                 NIL, /* fdw_restrictinfo was missing <<<<<<<<<<<<<< */
#endif
	                 NIL /* no fdw_private list */));

Also I found that the makefile needed to change from...
SHLIB_LINK = -lodbc
to
SHLIB_LINK = -lodbc32
I'm using unixodbc, so it compiled okay but the CREATE EXTENSION would not work in PG without first making the above change.

robe2 added a commit to robe2/odbc_fdw that referenced this issue Dec 22, 2024
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

No branches or pull requests

2 participants