RMLio / rmlmapper-java

The RMLMapper executes RML rules to generate high quality Linked Data from multiple originally (semi-)structured data sources
http://rml.io
MIT License
146 stars 61 forks source link

PostgreSQL JDBC Driver Update #146

Closed KTBL-DanielMartini closed 2 years ago

KTBL-DanielMartini commented 2 years ago

I've been lately testing a build from a recent pull of rmlmapper-java against the official postgres docker image. Trying a simple mapping failed with the following error message:

14:56:52.328 [main] ERROR be.ugent.rml.cli.Main               .main(390) - The authentication type 10 is not supported. Check that you have configured the pg_hba.conf file to include the client's IP address or subnet, and that it is using an authentication scheme supported by the driver.

Doing a bit of research unveiled that the postgres docker image is using scram-sha-256 as its default authentication type for network accesses to the database in the access control configuration in its pg_hba.conf file (and potentially other installations of newer Postgres versions as well). This is not yet supported by the version of the PostgreSQL JDBC driver given as a dependency in rmlmapper-java's pom.xml. According to the driver's release notes support for that was introduced in version 42.2.0.

So I did the following:

I changed the section for that in the pom.xml from:

<dependency>
    <groupId>postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>9.1-901-1.jdbc4</version>
</dependency>

to:

<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.3.2</version>
</dependency>

That did the trick and made the connection and a simple mapping work.

Would it be possible to "officially" update this dependency?

Note that I had to do my final builds with mvn install -DskipTests as some of the tests failed for me - notably not the Postgres tests however. The latter all finished successfully even after the modification. Nevertheless it might make sense if somebody else could confirm that the driver update works as expected before integrating the change.

DylanVanAssche commented 2 years ago

Hi @KTBL-DanielMartini !

Thanks for investigating this! I added your change to the development branch. I ran all tests and they pass successfully. To test them all, you need to do additional setups for Oracle DB as they don't allow to share their JARs through Maven Central. Our internal CI/CD system has this setup and verified that your change works fine with all test cases, thanks!