Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION) - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)
Date
Msg-id Pine.BSO.4.64.0904210233230.17043@leary.csoft.net
Whole thread Raw
In response to Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)  ("j.random.programmer" <javadesigner@yahoo.com>)
Responses Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc

On Mon, 20 Apr 2009, j.random.programmer wrote:

> While using JDBC MetaData for my O/R tool, I've come across this
> bug recently;
>
> When getting JDBC Meta data, the column numbers for the
> following 2 columns, via ('ORDINAL_POSITION') of the 2
> columns are IDENTICAL:
>
> [1]
> colname=dictname, colnum=1, sqltype=12, typename=name, colsize=2147483647, nullable=false, isAutoIncrement=false,
remarks=null,hasRemarks=false, isPK=false, fkdata=null] 
>  --and--
> [2]
> colname=dict_name, colnum=1, sqltype=12, typename=text, colsize=2147483647, nullable=false, isAutoIncrement=false,
remarks=null,hasRemarks=false, isPK=false, fkdata=null] 
> -------------------------------------------------------------
>
> Note, "dict_name" does not show up via the \d pg_ts_dict
> output above but this, possibly extraneous column, does
> show up in the JDBC MetaData.

Without showing the calls you're making it's not completely clear what
your ORM tool is doing.  The attached test case of just getColumns has no
problems.

One thing to be careful of when using DatabaseMetaData is that the table
names are really table name patterns, so you may in fact have a pgftsedict
table that is also matching the pg_ts_dict pattern.

Kris Jurka

Attachment

pgsql-jdbc by date:

Previous
From: "j.random.programmer"
Date:
Subject: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)
Next
From: Oliver Jowett
Date:
Subject: Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)