Re: DatabaseMetaData.getTables returns lower-case column names - Mailing list pgsql-jdbc

From Thomas Kellerer
Subject Re: DatabaseMetaData.getTables returns lower-case column names
Date
Msg-id 51964B4A.2080504@gmx.net
Whole thread Raw
In response to DatabaseMetaData.getTables returns lower-case column names  (Július Štroffek <julo@stroffek.cz>)
List pgsql-jdbc
Július Štroffek wrote on 17.05.2013 17:06:
> I am using eclipselink with pgsql jdbc driver '9.2-1002 JDBC 4' and
> when eclipselink tries to get the list of available tables using the
> ${subject} function PostgreSQL JDBC will return the result having the
> column names lower case.
>
> The JDBC API clearly describes them as upper-case, see
>
http://docs.oracle.com/javase/6/docs/api/java/sql/DatabaseMetaData.html#getTables%28java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String[]%29

I don't see any statement that claims the table or column names should be returned in upper case.

The driver should always return the names as _stored in the database_ which could mean lowercase, uppercase or mixed
casedepending on the DBMS. To find out _how_ the DBMS stores them you can use storesLowerCaseIdentifiers(),
storesMixedCaseIdentifiers()and storesUpperCaseIdentifiers() 

> Is there any reason why the names are returned as lower case?

Yes, because Postgres stores all (unquoted) identifiers in lowercase.



pgsql-jdbc by date:

Previous
From: Július Štroffek
Date:
Subject: DatabaseMetaData.getTables returns lower-case column names
Next
From: Rui Zhu
Date:
Subject: [PATCH] Driver.knownProperties key is "tcpKeepAlive", but URL parameter is created with "tcpkeepalive", which renders setTcpKeepAlive(boolean) uneffective