Re: [hibernate-team] PostgreSQLDialect - Mailing list pgsql-hackers

From Dave Cramer
Subject Re: [hibernate-team] PostgreSQLDialect
Date
Msg-id D6712F65-BED8-4719-93E4-3F8B5368C28E@fastcrypt.com
Whole thread Raw
In response to Re: [hibernate-team] PostgreSQLDialect  ("Tom Dunstan" <pgsql@tomd.cc>)
List pgsql-hackers
On 12-Nov-07, at 11:33 AM, Tom Dunstan wrote:

> On Nov 12, 2007 4:08 PM, Alvaro Herrera <alvherre@alvh.no-ip.org>  
> wrote:
>>> What should the driver report then ? I believe the backend code  
>>> considers 8
>>> to be the major version, and 0123 to be the minor versions ?
>>
>> No, 8.1 is the major version.  In 8.2.5, 8.2 is the major, 5 is the
>> minor version.
>
> Which is nice in theory, except that the JDBC API doesn't give us the
> option of a non-int major version number. We could fudge it with 80,
> 81 etc, but that's pretty ugly. You can imagine some database client
> out there reporting that you're connected to a postgresql 82.5
> database, rather than using the getDatabaseProductVersion() method
> which is intended for that sort of thing.
>
> For the most part, getting the combination of the major and minor
> numbers as currently implemented should be enough for anything using
> the driver, as we normally don't care about the difference between
> 8.2.1 and 8.2.2 in application code (heaven help mysql :)). It only
> came up in this case because the minor number (as reported by the JDBC
> driver) wasn't passed through.
>
I just looked at the code and AFAICT we can just ask the driver for  
both major and minor to get something along the lines of

8,0 or 8,2 for major, minor respectively.

Dave


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: 8.2.3: Server crashes on Windows using Eclipse/Junit
Next
From: Andrew Dunstan
Date:
Subject: Re: [GENERAL] plperl and regexps with accented characters - incompatible?