atris / JDBC_FDW

FDW that wraps JDBC for PostgreSQL.It can be used to connect and fetch data from any data source that supports JDBC
Other
67 stars 38 forks source link

Support PostgreSQL 9.5 #19

Open mc-soi opened 9 years ago

mc-soi commented 9 years ago

In order to comile with PostgreSQL 9.5, in file JDBC_FDW/jdbc_fdw.c, on line 1079, change the ending from: scan_relid, NIL, NIL)); to: scan_relid, NIL, NIL, NIL));

I still use this (jdbc_fdw) over jdbc2_fdw when I need to access queries (SQL statements & stored procedures) as jdbc2_fdw seems to only supports tables. However, the Java file names overlap between projects. I do not check to see if the Java files are any different. Technically, the other project should rename their files, however, I am not sure if they anticipated people using both jdbc_fdw and jdbc2_fdw side by side. This patch adds support for PostgreSQL 9.5 by making the change above, and changes the code to use the new Java file names: https://gist.github.com/mc-soi/cce26e0e6186d416a9cc You might have to rename the files before applying this patch.

atris commented 9 years ago

Thanks!

Can you rebase this patch to JDBC_FDW's current code base and open a pull request please? It only makes sense that this patch gets committed in your name!

rinolf commented 8 years ago

Hi,

Looks like make_foreignscan need 8 arguments now (http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=5043193b78919a1bd144563aadc2f7f726549913) so after applying the patch I still get an error message about too few arguments. I tried to add one more NIL so it now look like this: return (make_foreignscan(tlist, scan_clauses, scan_relid, NIL, NIL, NIL, NIL, NIL));

But I then get the message: "struct Plan " expected but argument is type "struct List " (translation by me as the server for some reason is not in English...)

I'm not a programmer so I might have misunderstood something. I'm using postgresql 9.5.0 source code uploaded Januari 4 from http://www.postgresql.org/ftp/source/v9.5.0/.

Is there an easy way to solve this?

santanab commented 8 years ago

For compile correctly with 9.5, I had to add more arguments for the create_foreignscan_path and the make_foreignscan parts.

/* Create a ForeignPath node and add it as only possible path _/ /_addpath(baserel, (Path)create_foreignscan_path(root, baserel, baserel->rows, startup_cost, total_cost, NIL, NULL, NIL)); */ --commented addpath(baserel, (Path)create_foreignscan_path(root, baserel, baserel->rows, startup_cost, total_cost, NIL, NULL, NIL, NIL));

/* Create the ForeignScan node _/ /_return (make_foreignscan(tlist, scan_clauses, scan_relid, NIL, NIL)); */ --commented return (make_foreignscan(tlist, scan_clauses, scan_relid, NIL, NIL, NIL, NIL, NIL));

atris commented 8 years ago

Can you submit a Patch for the same please?

On Thu, Apr 7, 2016 at 11:31 PM, santanab notifications@github.com wrote:

For compile correctly with 9.5, I had to add more arguments for the create_foreignscan_path and the make_foreignscan parts.

/* Create a ForeignPath node and add it as only possible path _/ /_addpath(baserel, (Path )create_foreignscan_path(root, baserel, baserel->rows, startup_cost, total_cost, NIL, NULL, NIL)); */ --commented addpath(baserel, (Path)create_foreignscan_path(root, baserel, baserel->rows, startup_cost, total_cost, NIL, NULL, NIL, NIL));

/* Create the ForeignScan node _/ /_return (make_foreignscan(tlist, scan_clauses, scan_relid, NIL, NIL)); */ --commented return (make_foreignscan(tlist, scan_clauses, scan_relid, NIL, NIL, NIL, NIL, NIL));

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/atris/JDBC_FDW/issues/19#issuecomment-206954177

Regards,

Atri l'apprenant