pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: JDBC driver returns different version strings on Ubuntu and CentOS
Date: Tue, 20 Feb 2018 08:46:14 +0100
Message-ID: <p6gjk8$u73$1@blaine.gmane.org> (raw)
In-Reply-To: <CA+cVU8NLtWYS0M3fiUKgYTWQ9AY2KrmdMFTTC41phkxp7zifOg@mail.gmail.com>
References: <p6ero2$ge$1@blaine.gmane.org>
	<CA+cVU8NLtWYS0M3fiUKgYTWQ9AY2KrmdMFTTC41phkxp7zifOg@mail.gmail.com>

Hmm, there must be _some_ parsing going on, because 

   select current_setting('server_version')

returns "10.2 (Ubuntu 10.2-1.pgdg16.04+1)" on the Ubuntu installation, so I wonder how the 10.2.2 is created from that by the JDBC driver. 

It is not really important, I am just wondering...

Regards
Thomas
 

Jorge Solórzano schrieb am 19.02.2018 um 18:04:
> The DatabaseMetaData.getDatabaseProductVersion() returns the exact
> string of ParameterStatus "server_version", and this version can be
> different from ditro to distro, in my Ubuntu the "server_version"
> returns: "10.2 (Ubuntu 10.2-1.pgdg16.04+1)". In other words the
> version returned is not "parsed/cleaned", and if you need to
> implement some logic based on the version, is better to use
> getDatabaseMajorVersion() and getDatabaseMinorVersion().
> 
> Regards.
> 
> On Mon, Feb 19, 2018 at 9:52 AM, Thomas Kellerer <spam_eater@gmx.net <mailto:spam_eater@gmx.net>> wrote:
> 
>     I have just noticed that DatabaseMetaData.getDatabaseProductVersion() returns the String "10.2.2" when connected to a server running on Ubuntu, but returns "10.2" when connected to a server running on CentOS or Windows.
> 
>     Is there a specific reason for this?
> 
>     It's a bit confusing because 10.2.2 doesn't actually exists as a "real" Postgres version.
> 
>     This happens with the driver versions 42.1.4 and 42.2.1 (haven tried others)
> 
>     Regards
>     Thomas
> 
> 
> 
> 






view thread (9+ messages)  latest in thread

Message-ID: <p6gjk8$u73$1@blaine.gmane.org>
Permalink:  ../p6gjk8$u73$1@blaine.gmane.org/
Also on:    postgresql.org/message-id/p6gjk8$u73$1@blaine.gmane.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: spam_eater@gmx.net
  Subject: Re: JDBC driver returns different version strings on Ubuntu and CentOS
  In-Reply-To: <p6gjk8$u73$1@blaine.gmane.org>
  References: <p6ero2$ge$1@blaine.gmane.org> <CA+cVU8NLtWYS0M3fiUKgYTWQ9AY2KrmdMFTTC41phkxp7zifOg@mail.gmail.com> <p6gjk8$u73$1@blaine.gmane.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox