Re: JDBC driver returns different version strings on Ubuntu and CentOS

From: Jorge Solórzano <jorsol(at)gmail(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: Re: JDBC driver returns different version strings on Ubuntu and CentOS
Date: 2018-02-21 18:07:50
Message-ID: CA+cVU8PwVX5m49RAZGUaY7zVe+EWpnW6cBHyb543rEizMX3e7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, Feb 21, 2018 at 11:43 AM, Thomas Kellerer <spam_eater(at)gmx(dot)net>
wrote:

>
> As I said, that's the return value of DatabaseMetaData.
> ​​
> getDatabaseProductVersion()
>
> So apparently there *is* some parsing going on.
>
>

PgDatabaseMetaData.getDatabaseProductVersion() calls
connection.getDBVersionNumber();

https://github.com/pgjdbc/pgjdbc/blob/45c32bc6af2e140ff86dabd718344c74fc244394/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java#L150

PgConnection.getDBVersionNumber() calls queryExecutor.getServerVersion();

https://github.com/pgjdbc/pgjdbc/blob/45c32bc6af2e140ff86dabd718344c74fc244394/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java#L892


The receiveParameterStatus() of QueryExecutorImpl calls
setServerVersion(value) of QueryExecutorBase:

https://github.com/pgjdbc/pgjdbc/blob/45c32bc6af2e140ff86dabd718344c74fc244394/pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java#L2637

https://github.com/pgjdbc/pgjdbc/blob/45c32bc6af2e140ff86dabd718344c74fc244394/pgjdbc/src/main/java/org/postgresql/core/QueryExecutorBase.java#L229

There is no parsing going on.​

In my Ubuntu
getDatabaseProductVersion() returns "10.2 (Ubuntu 10.2-1.pgdg16.04+1)".

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vladimir Sitnikov 2018-02-21 18:25:37 Re: JDBC driver returns different version strings on Ubuntu and CentOS
Previous Message Thomas Kellerer 2018-02-21 17:43:59 Re: JDBC driver returns different version strings on Ubuntu and CentOS