Player87 is right, it works just by replacing the newer version 9.6* with 9.5.* of the PostgresSQL server.
But, there is another solution. For a Java project, I have also tried leaving PostgresSQL server on 9.6.* and updated the PostgresSQL driver, from version 9.4-1203 to the newest one 9.4-1211.
In a maven pom.xml file:
<postgresql.version>9.4.1211</postgresql.version>
That worked for me too.