BUG: DatabaseMetaData.getColumns isn't case insensitive

Поиск
Список
Период
Сортировка
От maly.velky@email.cz
Тема BUG: DatabaseMetaData.getColumns isn't case insensitive
Дата
Msg-id 1711.2738-17750-2075670179-1233581999@email.cz
обсуждение исходный текст
Ответы Re: BUG: DatabaseMetaData.getColumns isn't case insensitive  (Dave Cramer <pg@fastcrypt.com>)
Re: BUG: DatabaseMetaData.getColumns isn't case insensitive  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
Hello,

I'was trying to get meta data of a column and discovered that the column name is case sensitive though it should be
caseinsensitive. I don't know if this can be somehow determined by a configuration or environment change because I
believethat till recently it  worked in a case-insensitive manner. 

I've the table studna_monitor.mon_user_session with the column "username". The following code wrongly returns null
(notice"username".toUpperCase()): 
---
String col = null;
Class.forName("org.postgresql.Driver");
String url = "jdbc:postgresql://localhost/mydb?user=me&password=secret";
Connection conn = DriverManager.getConnection(url);
    DatabaseMetaData databaseMetaData = conn.getMetaData();
    ResultSet columnsMD = databaseMetaData.getColumns(null, "studna_monitor", "mon_user_session",
"username".toUpperCase());
    while(columnsMD.next()) {
        col = columnsMD.getString("COLUMN_NAME");
    }
    return col;
---
While the following returns the column name "username":
---
...
ResultSet columnsMD = databaseMetaData.getColumns(null, "studna_monitor", "mon_user_session",
"username".toLowerCase());
...
---

BTW, the metadata reports:
supportsMixedCaseIdentifiers: false
supportsMixedCaseQuotedIdentifiers: true
(which is pretty much expected)

Driver: postgresql-8.3-604.jdbc3.jar, postgresql-jdbc3-8.2.jar (as distributed with Ubuntu, doesn't provide build
number)
Server:  Postgres 8.2.6 for Solaris


Thank you.
Jakub Holy
maly.velky@email.cz

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Support of getting generated keys in driver version 8.4devel
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: BUG: DatabaseMetaData.getColumns isn't case insensitive