Bug in DatabaseMetaData.getColumns(...)?? - Mailing list pgsql-jdbc

From Thorsten Meinl
Subject Bug in DatabaseMetaData.getColumns(...)??
Date
Msg-id 3DE7F1C9.8070806@meinl.bnv-bamberg.de
Whole thread Raw
Responses Re: Bug in DatabaseMetaData.getColumns(...)??  (Kris Jurka <books@ejurka.com>)
Re: Bug in DatabaseMetaData.getColumns(...)?? Patch applied  (Dave Cramer <Dave@micro-automation.net>)
List pgsql-jdbc
Hello,

I just downloaded the new 7.3 release of PostgreSQL and also tried the
new JDBC-drivers shipped with the release. And I have problems with the
new driver.
The Java-API says for the function DatabaseMetaData.getColumns(...):

<snip>
Retrieves a description of table columns available in the specified
catalog.

Only column descriptions matching the catalog, schema, table and column
name criteria are returned. They are ordered by |TABLE_SCHEM|,
|TABLE_NAME|, and |ORDINAL_POSITION|.
</snip>

Looking in org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java I
find in line 2312 in getColumns(...)

<snip>
sql += " ORDER BY nspname,relname,attname ";
</snip>

So the order is wrong, the columns or sorted by their name and not by
their position in the table-defintion. This broke my code.
Is this a bug or an intended feature?

Greetings

Thorsten




pgsql-jdbc by date:

Previous
From: Grzegorz Gałęzowski
Date:
Subject: J2ME
Next
From: Bruce Momjian
Date:
Subject: Re: Measuring time of select query