On Mon, Aug 29, 2016 at 11:37 AM, Robert Haas <robertmh...@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

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

import java.sql.*;
public final class PrintVersion
    public static void main(String[] args) throws Exception
        Connection con =
        DatabaseMetaData dbmd = con.getMetaData();
        System.out.println(dbmd.getDatabaseMajorVersion() + "  " +

... 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

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to