Re: Uppercase problem in jdbc2 DatabaseMetaData.getColumns() - Mailing list pgsql-jdbc

From Patrice Le Gurun
Subject Re: Uppercase problem in jdbc2 DatabaseMetaData.getColumns()
Date
Msg-id 200105311548.f4VFmNE16132@postgresql.org
Whole thread Raw
In response to Re: Uppercase problem in jdbc2 DatabaseMetaData.getColumns()  (Pete Jewell <pete@example.compulink.co.uk>)
List pgsql-jdbc
Pete Jewell <pete@example.compulink.co.uk> writes:

> That's odd - I thought pgsql was case insensitive when it came to
> table and column names?  Ie,
>
> SELECT ID FROM TESTDB;
>
> and
>
> select id from testdb;
>
> are functionally equivalent?

Not really with the JDBC driver. You have to put column and table names into
double quotes if you have those names with uppercase. Ie, with a table TestDB
with a column named IdTest, you must sent the request :
    SELECT * FROM "TestDb" WHERE "IdTest" = 3
to Statement.execute() if you want to read the row. If you forget the quotes,
you'll have an SQLException which said something like "Table testdb does not
exist."

--
Patrice Le Gurun
mailto:patrice.le-gurun@wanadoo.fr
"GNU/Linux lets you drink more beer !"

pgsql-jdbc by date:

Previous
From: Pete Jewell
Date:
Subject: Re: Uppercase problem in jdbc2 DatabaseMetaData.getColumns()
Next
From: Joseph Shraibman
Date:
Subject: Re: [GENERAL] Does ASSERTION constraint work ?