BUG #3480: JDBC driver: getIndexInfo() returns quotes around quoted column names

From: "Andrei Badea" <andrei(dot)badea(at)sun(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3480: JDBC driver: getIndexInfo() returns quotes around quoted column names
Date: 2007-07-23 13:58:47
Message-ID: 200707231358.l6NDwlWh026230@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3480
Logged by: Andrei Badea
Email address: andrei(dot)badea(at)sun(dot)com
PostgreSQL version: 8.2.4
Operating system: Debian GNU/Linux testing/lenny, Linux 2.6.17
Description: JDBC driver: getIndexInfo() returns quotes around quoted
column names
Details:

JDBC3 driver 8.2-505 and JDBC4 driver 8.3dev-600.

The DatabaseMetaData.getIndexInfo() method returns quotes around quoted
column names, unlike the getColumns() method. To reproduce run the following
statement in a database named "test" and the "public" schema:

create table "CUSTOMER" ("CUSTOMER_ID" int not null primary key);

connect to the database and execute the following code:

// java.sql.Connection conn
DatabaseMetaData dmd = conn.getMetaData();
// print the columns
ResultSet rs = dmd.getColumns("test", "public", "CUSTOMER", "%");
try {
while (rs.next()) {
System.out.println(rs.getString("COLUMN_NAME"));
}
} finally {
rs.close();
}
// print the primary key columns
rs = dmd.getIndexInfo("test", "public", "CUSTOMER", true, true);
try {
while (rs.next()) {
System.out.println(rs.getString("COLUMN_NAME"));
}
} finally {
rs.close();
}

The code prints

CUSTOMER_ID
"CUSTOMER_ID"

while it should probably have printed

CUSTOMER_ID
CUSTOMER_ID

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Gregory Stark 2007-07-23 14:25:03 Re: BUG #3479: contraint exclusion and locks
Previous Message Tiago Jacobs 2007-07-23 13:24:08 BUG #3479: contraint exclusion and locks