Re: [PATCH] problem with DatabaseMetaData and mixed case table - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: [PATCH] problem with DatabaseMetaData and mixed case table
Date
Msg-id 42F7D795.3050707@opencloud.com
Whole thread Raw
In response to [PATCH] problem with DatabaseMetaData and mixed case table names  (Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>)
List 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

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: get question mark with Chinese/Japanese character ?
Next
From: Giuseppe Sacco
Date:
Subject: Re: [PATCH] problem with DatabaseMetaData and mixed case