Re: [JDBC] old JDBC driver (8.1-JDBC3) can connect to postgresql 9.x ?
От | itoshun001@efeel.to |
---|---|
Тема | Re: [JDBC] old JDBC driver (8.1-JDBC3) can connect to postgresql 9.x ? |
Дата | |
Msg-id | 973148.15452.qm@web32005.mail.ssk.yahoo.co.jp обсуждение исходный текст |
Ответ на | Re: [JDBC] old JDBC driver (8.1-JDBC3) can connect to postgresql 9.x ? (Jorge Solórzano <jorsol@gmail.com>) |
Список | 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 versionsof 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@gmail.com> >To: "itoshun001@efeel.to" <itoshun001@efeel.to> >Cc: "pgsql-jdbc@postgresql.org" <pgsql-jdbc@postgresql.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@efeel.to <itoshun001@efeel.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 chanceto hit a problem with pg_catalog updates, the pg_catalog is an internal postgresql table that contains many info consumedby the pgjdbc driver and newer versions of the driver can handle all these variations, so for instance the pgjdbcdriver 9.3 Build 1103 can connect without problems to older postgresql versions like the one you are using (8.3) andit 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 itmeans that the version you are using (8.1-404 JDBC3) was essentially for postgresql 8.1 and older, but you are using itfor 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 currentversion 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 shouldbe 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 (basedon the Java 5 version) the PgJDBC 9.3 Build 1103 and not the 8.1-404, but as I said before, always test for potentialregressions. > > > >>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 compatibilityissues, so is NOT recomeded to use an older driver version to connect to a newer postgresql version, you shouldalways try to use the latest driver. For example I have a web app that is still on PostgreSQL 9.1 but it's using thelatest driver version 9.4.1212. What I mean is that is better to have a new jdbc driver connecting to an older postgresqlinstance than the opposite. > > >To clarify your points, PostgreSQL knows nothing about Java or JDBC, the PgJDBC driver is a pure Java driver that implementsthe native protocol of PostgreSQL, so PgJDBC "talks" in the PostgreSQL native language (the binary or text protocolthat postgres understand). So when a new version of PostgreSQL comes out, the driver has to "understand" the newor changed stuff so an older version of the driver do not recognize the changed stuff and there might hit a compatibilityissue. > > >And as John said, Java 5 is obsolete, my recomendation is to try upgrading the Java version, at least to Java 6, Java isfor 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 supportedversion. > > >As always, test, test and do more test for any potential problem. > > > >>Best regards, >>itoshun >> > >
В списке pgsql-jdbc по дате отправления:
Предыдущее
От: Jorge SolórzanoДата:
Сообщение: Re: [JDBC] old JDBC driver (8.1-JDBC3) can connect to postgresql 9.x ?