Bug in DatabaseMetaData.getColumns(...)??

Поиск
Список
Период
Сортировка
Искать

Bug in DatabaseMetaData.getColumns(...)??

От:
Thorsten Meinl <Thorsten@meinl.bnv-bamberg.de>
Дата:
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(...):


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|.


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


sql += " ORDER BY nspname,relname,attname ";


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



Re: Bug in DatabaseMetaData.getColumns(...)??

От:
Kris Jurka <books@ejurka.com>
Дата:


On Sat, 30 Nov 2002, Thorsten Meinl wrote:

> 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(...):
>
> [cut]
>
> 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?

This is a bug.  I have submitted a patch to repair this which will
hopefully be applied shortly.

Kris Jurka

Re: Bug in DatabaseMetaData.getColumns(...)??

От:
Dave Cramer <Dave@micro-automation.net>
Дата:
Kris,

where did you submit the patch, patches? I guess I'm "it" while Barry is
away

Dave
On Mon, 2002-12-02 at 13:57, Kris Jurka wrote:
> On Sat, 30 Nov 2002, Thorsten Meinl wrote:
> 
> > 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(...):
> >
> > [cut]
> >
> > 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?
> 
> This is a bug.  I have submitted a patch to repair this which will
> hopefully be applied shortly.
> 
> Kris Jurka
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
-- 
Dave Cramer 

Re: Bug in DatabaseMetaData.getColumns(...)??

От:
Kris Jurka <books@ejurka.com>
Дата:

Yes,

http://fts.postgresql.org/db/mw/msg.html?mid=1359758


On 2 Dec 2002, Dave Cramer wrote:

> Kris,
>
> where did you submit the patch, patches? I guess I'm "it" while Barry is
> away
>
> Dave
> On Mon, 2002-12-02 at 13:57, Kris Jurka wrote:
> > On Sat, 30 Nov 2002, Thorsten Meinl wrote:
> >
> > > 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(...):
> > >
> > > [cut]
> > >
> > > 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?
> >
> > This is a bug.  I have submitted a patch to repair this which will
> > hopefully be applied shortly.
> >
> > Kris Jurka
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
> --
> Dave Cramer 
>

Re: Bug in DatabaseMetaData.getColumns(...)?? Patch applied

От:
Dave Cramer <Dave@micro-automation.net>
Дата:
This has been patched in the current sources

Dave
On Fri, 2002-11-29 at 18:01, Thorsten Meinl wrote:
> 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(...):
> 
> 
> 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|.
> 
> 
> Looking in org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java I 
> find in line 2312 in getColumns(...)
> 
> 
> sql += " ORDER BY nspname,relname,attname ";
> 
> 
> 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
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
-- 
Dave Cramer 

FAQ