Re: old JDBC driver (8.1-JDBC3) can connect to postgresql 9.x ?

From: "itoshun001(at)efeel(dot)to" <itoshun001(at)efeel(dot)to>
To: Jorge Solórzano <jorsol(at)gmail(dot)com>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: old JDBC driver (8.1-JDBC3) can connect to postgresql 9.x ?
Date: 2017-01-17 02:39:33
Message-ID: 973148.15452.qm@web32005.mail.ssk.yahoo.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Jorge and John

Thank you so much for your kind explanations in spite of questions about obsoleted versions of JVM and not supported versions of JDBC driver 

Now I have understood risks to use old version of JDBC driver such as a schema catalog change.
Then we will try not to use old version of JDBC to connect to postgresql 9.x.

Thanks much and best regards,
itoshun
----- Original Message -----
>From: Jorge Solórzano <jorsol(at)gmail(dot)com>
>To: "itoshun001(at)efeel(dot)to" <itoshun001(at)efeel(dot)to>
>Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
>Date: 2017/1/17, Tue 11:02
>Subject: Re: [JDBC] old JDBC driver (8.1-JDBC3) can connect to postgresql 9.x ?
>
>
>
>
>On Mon, Jan 16, 2017 at 6:05 PM, itoshun001(at)efeel(dot)to <itoshun001(at)efeel(dot)to> wrote:
>
>Hi Jorge
>>
>>Thank you for your accurate answers and kind understanding for our situation.
>>Now I understand below and these info is very useful for our team !
>>
>>  - the old driver(8.1-404 JDBC3) technically can connect to postgresql 9.3 but some new features should not be available, and we won't get the bugfixes of later version.
>>
>
>
>​Yes technically, but as John points out ​you could hit a schema catalog change so while it *might* work, there is a chance to hit a problem with pg_catalog updates, the pg_catalog is an internal postgresql table that contains many info consumed by the pgjdbc driver and newer versions of the driver can handle all these variations, so for instance the pgjdbc driver 9.3 Build 1103 can connect without problems to older postgresql versions like the one you are using (8.3) and it can connect to newer postgresql versions like 9.3.
>
>For many years the pgjdbc driver followed the versions of the server to declare some kind of compatibility, basically it means that the version you are using (8.1-404 JDBC3) was essentially for postgresql 8.1 and older, but you are using it for postgresql 8.3 and it works (for you). From the version 9.4.x of the driver that is no longer the case, and the current version 9.4.1212 works on PostgreSQL 9.6 too.
>

>
>>  - the driver should be highly compatible with earlier versions, and if our web app is using standard jdbc, then it should be practically transparent the change (we don't even need to recompile).
>>
>
>
>Yes, it should work for postgresql 8.3 and postgresql 9.3 (and everything between) that means that you should be using (based on the Java 5 version) the PgJDBC 9.3 Build 1103 and not the 8.1-404, but as I said before, always test for potential regressions.
>

>
>>One more question which might be last question....
>>
>>  (Q) My understanding below is correct ??
>>
>>      Versions of jdbc driver that supported Java 5 can't connect to postgresql 9.4 or later 
>>      because 
>>       - the versions of jdbc driver don't support JDBC 4, 41 and 42
>>       - the versions of postreqsql don't support JDBC3
>>
>
>
>​​Let me be cristal clear​, it *might* work ​but again, you might hit a problem with pg_catalog updates and others compatibility issues, so is NOT recomeded to use an older driver version to connect to a newer postgresql version, you should always try to use the latest driver. For example I have a web app that is still on PostgreSQL 9.1 but it's using the latest driver version 9.4.1212. What I mean is that is better to have a new jdbc driver connecting to an older postgresql instance than the opposite.
>
>
>To clarify your points, PostgreSQL knows nothing about Java or JDBC, the PgJDBC driver is a pure Java driver that implements the native protocol of PostgreSQL, so PgJDBC "talks" in the PostgreSQL native language (the binary or text protocol that postgres understand). So when a new version of PostgreSQL comes out, the driver has to "understand" the new or changed stuff so an older version of the driver do not recognize the changed stuff and there might hit a compatibility issue.
>
>
>And as John said, Java 5 is obsolete, my recomendation is to try upgrading the Java version, at least to Java 6, Java is for the most part backward compatible, so you can use a new Java Runtime for a Java 5 compiled app.
>
>
>Then try to update the PgJDBC driver to the latest version, and finally try to upgrade the PostgreSQL server to a supported version.
>
>
>As always, test, test and do more test for any potential problem.
>

>
>>Best regards,
>>itoshun
>>
>
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Philippe Marschall 2017-01-17 08:25:02 Review request for PR#698
Previous Message Jorge Solórzano 2017-01-17 02:02:57 Re: old JDBC driver (8.1-JDBC3) can connect to postgresql 9.x ?