pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
DatabaseMetaData.getTables returns lower-case column names
2+ messages / 2 participants
[nested] [flat]

* DatabaseMetaData.getTables returns lower-case column names
@ 2013-05-17 15:06 Július Štroffek <julo@stroffek.cz>
  2013-05-17 15:22 ` Re: DatabaseMetaData.getTables returns lower-case column names Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Július Štroffek @ 2013-05-17 15:06 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

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...[]%29

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

Please keep me CC-ed as I am not on this list.

Thank you,
Kind regards

Julo

--
Julius Stroffek
http://www.stroffek.cz


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: DatabaseMetaData.getTables returns lower-case column names
  2013-05-17 15:06 DatabaseMetaData.getTables returns lower-case column names Július Štroffek <julo@stroffek.cz>
@ 2013-05-17 15:22 ` Thomas Kellerer <spam_eater@gmx.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Thomas Kellerer @ 2013-05-17 15:22 UTC (permalink / raw)
  To: 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...[]%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 case depending 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.



-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2013-05-17 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-05-17 15:06 DatabaseMetaData.getTables returns lower-case column names Július Štroffek <julo@stroffek.cz>
2013-05-17 15:22 ` Thomas Kellerer <spam_eater@gmx.net>

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