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
66 stars 38 forks source link

fix for postgres 9.5 compatibility (but does not implement IMPORT SCH… #24

Closed numjcp closed 8 years ago

numjcp commented 8 years ago

Hello

As many other users, I faced a compatibility problem when building jdbc_fdw against postgres 9.5

Please review my changes to fix it.

Regards

atris commented 8 years ago

Thanks!

numjcp commented 8 years ago

I would be please to implement support for IMPORT SCHEMA statements if you provide me with a short introduction to jdbc_fdw architecture.

regards

Le 20 avr. 2016 à 17:31, Atri Sharma notifications@github.com a écrit :

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/atris/JDBC_FDW/pull/24#issuecomment-212479038

atris commented 8 years ago

Hi,

I would be glad to do that. Are you comfortable with FDW architecture in general?

Regards,

Atri

On Wed, Apr 20, 2016 at 9:03 PM, numjcp notifications@github.com wrote:

I would be please to implement support for IMPORT SCHEMA statements if you provide me with a short introduction to jdbc_fdw architecture.

regards

Le 20 avr. 2016 à 17:31, Atri Sharma notifications@github.com a écrit :

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub < https://github.com/atris/JDBC_FDW/pull/24#issuecomment-212479038>

— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/atris/JDBC_FDW/pull/24#issuecomment-212479804

Regards,

Atri l'apprenant

numjcp commented 8 years ago

not yet

are you french ? I’m from Le Mans.

Le 20 avr. 2016 à 17:41, Atri Sharma notifications@github.com a écrit :

Hi,

I would be glad to do that. Are you comfortable with FDW architecture in general?

Regards,

Atri

On Wed, Apr 20, 2016 at 9:03 PM, numjcp notifications@github.com wrote:

I would be please to implement support for IMPORT SCHEMA statements if you provide me with a short introduction to jdbc_fdw architecture.

regards

Le 20 avr. 2016 à 17:31, Atri Sharma notifications@github.com a écrit :

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub < https://github.com/atris/JDBC_FDW/pull/24#issuecomment-212479038>

— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/atris/JDBC_FDW/pull/24#issuecomment-212479804

Regards,

Atri l'apprenant — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/atris/JDBC_FDW/pull/24#issuecomment-212482439

atris commented 8 years ago

I am from India.

Basically, JDBC_FDW uses JNI to spawn JVM and execute direct JDBC routines to fetch and receive data. The query string is directly passed to JDBC.

On Wed, Apr 20, 2016 at 9:53 PM, numjcp notifications@github.com wrote:

not yet

are you french ? I’m from Le Mans.

Le 20 avr. 2016 à 17:41, Atri Sharma notifications@github.com a écrit :

Hi,

I would be glad to do that. Are you comfortable with FDW architecture in general?

Regards,

Atri

On Wed, Apr 20, 2016 at 9:03 PM, numjcp notifications@github.com wrote:

I would be please to implement support for IMPORT SCHEMA statements if you provide me with a short introduction to jdbc_fdw architecture.

regards

Le 20 avr. 2016 à 17:31, Atri Sharma notifications@github.com a écrit :

Thanks!

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub < https://github.com/atris/JDBC_FDW/pull/24#issuecomment-212479038>

— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/atris/JDBC_FDW/pull/24#issuecomment-212479804

Regards,

Atri l'apprenant — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub < https://github.com/atris/JDBC_FDW/pull/24#issuecomment-212482439>

— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/atris/JDBC_FDW/pull/24#issuecomment-212500231

Regards,

Atri l'apprenant

numjcp commented 8 years ago

Dear ATRI

I get further with the implementation of the IMPORT SCHEMA support.

First the fdwapi callback to implement should be named jdbcImportForeignSchema

It is intended to return a list of commands to SQLy speaking create foreign table.

I walked through JDBCUtils and it looks like the last version would be helpfull. It provides a DatabaseMetaDataCallback interface than we can implement to get schema definitions we are looking for.

Here is an sample of how we could do this. Once done, we just have to reformat its output to a command list that would be returned by jdbcImportForeignSchema.

I suggest the following plan:

1-Upgrade JDBCUtils (and test it this is where i’m stucked) Would you please do it ? You have history in mind and will easily handle integration issues.

2-Implement GetTableNames and GetColNames within JDBCUtils and test I Can handle this.

3-wrap it within jdbcImportForeignSchema and test It’s been a long time I haven’t written so many lines of C but I can handle it.

Please find attached a patch adding the jdbcImportForeignSchema definition to jdbc_fdw.c

Regards

Julien

numjcp commented 8 years ago

Dear ATRI

I get further with the implementation of the IMPORT SCHEMA statement.

First the fdwapi callback to implement should be named jdbcImportForeignSchema

It is intended to return a list of commands to SQLy speaking create foreign table.

I walked through JDBCUtils and it looks like the last version would be helpfull. It provides a DatabaseMetaDataCallback interface than we can implement to get schema definitions we are looking for.

Here is an sample of how we could do this. http://stackoverflow.com/questions/1780677/get-list-of-all-table-names-from-spring-simplejdbctemplate

Once done, we just have to reformat its output to a command list that would be returned by jdbcImportForeignSchema to Postgres.

I suggest the following plan:

1-Upgrade JDBCUtils (and test it this is where i’m stucked) Would you please do it ? You have history in mind and will easily handle integration issues.

2-Implement GetTableNames and GetColNames within JDBCUtils and test I Can handle this.

3-wrap it within jdbcImportForeignSchema and test It’s been a long time I haven’t written so many lines of C but I can handle it.

Please find attached a patch adding the jdbcImportForeignSchema definition to jdbc_fdw.c

Regards

Julien