Thread: 7.4 JDBC driver with 8.1 server?

7.4 JDBC driver with 8.1 server?

From
Tom Lane
Date:
Can anyone comment offhand on how well a 7.4-vintage JDBC driver
(build 215 to be exact) would interoperate with a PG 8.1 server?
I need to make some recommendations about RHEL update procedures
and this question came up.

I have some recollection that JDBC looks into the system catalogs
to an extent that makes old drivers likely to break with newer
servers, but don't really know the details.

            regards, tom lane

Re: 7.4 JDBC driver with 8.1 server?

From
Kris Jurka
Date:

On Fri, 17 Feb 2006, Tom Lane wrote:

> Can anyone comment offhand on how well a 7.4-vintage JDBC driver
> (build 215 to be exact) would interoperate with a PG 8.1 server?
> I need to make some recommendations about RHEL update procedures
> and this question came up.
>
> I have some recollection that JDBC looks into the system catalogs
> to an extent that makes old drivers likely to break with newer
> servers, but don't really know the details.
>

That depends what you are doing with the driver.  I happen to have a 7.4
driver running against an 8.1 server without any problems, but all it does
is issue queries, it doesn't do anything more complicated.  Anyone making
use of DatabaseMetaData[1] will certainly have problems because these
methods provide a standard way of getting system information and have not
been updated past the 7.4 release.  A quick run of the 7.4 regression test
against a 8.1 server shows that anything retrieving foreign key
information will not work.  If this really is the only thing wrong it
would be a pretty simple fix to backport.  It's not been our policy to
ensure forward compatibility and the 7.4 driver isn't really maintained
anymore, but a I'd ignore that for a simple change for a big pg
contributor.

If this is just a step during an upgrade it seems reasonable to do, but
your message sounds a little bit like your thinking of keeping it that way
for a while.  Certainly the 8.0 introduction of strong typing has caused a
lot of people problems, but people are certainly not going to be happy if
they've upgraded, but don't get to use things like Savepoints.  I also
might consider using an 8.2dev driver that has been adjusted to set the
stringtype[2] parameter to unspecified.  This would reduce the impact of
the 8.0 changes while still providing new features.

Kris Jurka

[1] http://java.sun.com/j2se/1.5.0/docs/api/java/sql/DatabaseMetaData.html
[2] http://jdbc.postgresql.org/documentation/head/connect.html#connection-parameters

Re: 7.4 JDBC driver with 8.1 server?

From
Tom Lane
Date:
Kris Jurka <books@ejurka.com> writes:
> ... If this really is the only thing wrong it
> would be a pretty simple fix to backport.  It's not been our policy to
> ensure forward compatibility and the 7.4 driver isn't really maintained
> anymore, but a I'd ignore that for a simple change for a big pg
> contributor.

No need for a back-port.  The question wasn't about "what would it take
to make this work", it was about what would happen if we failed to
update the driver at all while updating the server.  Sounds like the
answer is "it won't work very well", which is about what I thought.
Thanks for the info!

            regards, tom lane

Re: 7.4 JDBC driver with 8.1 server?

From
Tom Lane
Date:
Kris Jurka <books@ejurka.com> writes:
> I also might consider using an 8.2dev driver that has been adjusted to
> set the stringtype[2] parameter to unspecified.  This would reduce the
> impact of the 8.0 changes while still providing new features.

This sounds like a pretty good idea to me, but I doubt Red Hat will go
for shipping a devel-snapshot driver ;-).  What I could possibly sell
them on is an 8.1 release driver plus a patch just to enable the
stringtype=unspecified behavior.  Do you have an idea how large such a
patch would be, and how painful to prepare it?

            regards, tom lane

Re: 7.4 JDBC driver with 8.1 server?

From
Kris Jurka
Date:

On Fri, 17 Feb 2006, Tom Lane wrote:

> Kris Jurka <books@ejurka.com> writes:
>> I also might consider using an 8.2dev driver that has been adjusted to
>> set the stringtype[2] parameter to unspecified.  This would reduce the
>> impact of the 8.0 changes while still providing new features.
>
> This sounds like a pretty good idea to me, but I doubt Red Hat will go
> for shipping a devel-snapshot driver ;-).  What I could possibly sell
> them on is an 8.1 release driver plus a patch just to enable the
> stringtype=unspecified behavior.  Do you have an idea how large such a
> patch would be, and how painful to prepare it?
>

The original commit which includes the patch is here:

http://gborg.postgresql.org/pipermail/pgjdbc-commit/2005-November/000416.html

Unfortunately it includes a number of other cleanups to other things as
well, but filtering that out should be pretty easy and the codebase really
hasn't changed much since 8.1.

Kris Jurka