Re: [PATCH] problem with DatabaseMetaData and mixed case table

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Giuseppe Sacco <giuseppe(at)eppesuigoccas(dot)homedns(dot)org>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [PATCH] problem with DatabaseMetaData and mixed case table
Date: 2005-08-08 22:07:17
Message-ID: 42F7D795.3050707@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Giuseppe Sacco wrote:

> The solution I propose is, since it seems that postgresql always store
> relation names in lowercase letters, to change the jdbc implementation
> of all methods like «getPrimaryKeys» in order to pass lowercase relation
> names to the backend.

This assumption is wrong. PostgreSQL stores mixed case identifiers, but
if you do not quote them then they are forced to lowercase during
parsing. If you want to preserve case, quote your identifiers. See
http://www.postgresql.org/docs/8.0/static/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS

> Is this the right way to solve the problem?

No. It's valid to have tables called "foo", "Foo", and "FOO" (possibly
simultaneously); your patch would destroy the ability to examine
anything but "foo".

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Giuseppe Sacco 2005-08-08 23:53:46 Re: [PATCH] problem with DatabaseMetaData and mixed case
Previous Message Kris Jurka 2005-08-08 21:58:25 Re: get question mark with Chinese/Japanese character ?