pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: DatabaseMetaData.getTables returns lower-case column names
Date: Fri, 17 May 2013 17:22:50 +0200
Message-ID: <51964B4A.2080504@gmx.net> (raw)
In-Reply-To: <CAGoAyueX3BFt0g9hxbp_7CShDGDVWi2T09AEfSWs0fZYpmvTmw@mail.gmail.com>
References: <CAGoAyueX3BFt0g9hxbp_7CShDGDVWi2T09AEfSWs0fZYpmvTmw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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



view thread (2+ messages)

Message-ID: <51964B4A.2080504@gmx.net>
Permalink:  ../51964B4A.2080504@gmx.net/
Also on:    postgresql.org/message-id/51964B4A.2080504@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: spam_eater@gmx.net
  Subject: Re: DatabaseMetaData.getTables returns lower-case column names
  In-Reply-To: <51964B4A.2080504@gmx.net>
  References: <CAGoAyueX3BFt0g9hxbp_7CShDGDVWi2T09AEfSWs0fZYpmvTmw@mail.gmail.com> <51964B4A.2080504@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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