From: | Patrice Le Gurun <patrice(dot)le-gurun(at)wanadoo(dot)fr> |
---|---|
To: | <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: Uppercase problem in jdbc2 DatabaseMetaData.getColumns() |
Date: | 2001-05-31 15:40:00 |
Message-ID: | 200105311548.f4VFmNE16132@postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Pete Jewell <pete(at)example(dot)compulink(dot)co(dot)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(dot)le-gurun(at)wanadoo(dot)fr
"GNU/Linux lets you drink more beer !"
From | Date | Subject | |
---|---|---|---|
Next Message | Joseph Shraibman | 2001-05-31 19:54:53 | Re: Does ASSERTION constraint work ? |
Previous Message | Pete Jewell | 2001-05-31 15:20:18 | Re: Uppercase problem in jdbc2 DatabaseMetaData.getColumns() |