Re: [PATCH] Send numeric version to clients

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: [PATCH] Send numeric version to clients
Дата
Msg-id CACjxUsPOTtA7LtOYuKRY6izx-1d66=Z0Fg2BaYsZoT659s+3Vg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Send numeric version to clients  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [PATCH] Send numeric version to clients  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Aug 29, 2016 at 11:37 AM, Robert Haas <robertmhaas@gmail.com> wrote:

> Note that these are all one-liners, and I bet the same is true in
> mostly other languages.  Even in notoriously verbose languages like
> Java or Cobol or ADA it can't be very hard.

Regarding Java, for anything above the driver itself the
JDBC API says the DatabaseMetaData class must implement these
methods:

int getDatabaseMajorVersion()   Retrieves the major version number of the underlying database.
int getDatabaseMinorVersion()   Retrieves the minor version number of the underlying database.
String getDatabaseProductVersion()   Retrieves the version number of this database product.

That *should* make it just a problem for the driver itself.  That
seems simple enough until you check what those methods have been
returning so far.  A somewhat minimal program to return these
values:

import java.sql.*;
public final class PrintVersion
{   public static void main(String[] args) throws Exception   {       Class.forName("org.postgresql.Driver");
Connectioncon =
 
DriverManager.getConnection("jdbc:postgresql://localhost/test?user=kgrittn");       DatabaseMetaData dbmd =
con.getMetaData();      System.out.println(dbmd.getDatabaseMajorVersion() + "  " +
 
dbmd.getDatabaseMinorVersion());       con.close();   }
}

... outputs this:

9  6

I'm not sure what the right thing to do is here.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Rémi Zara
Дата:
Сообщение: Re: OpenSSL 1.1 breaks configure and more
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] Send numeric version to clients