From: j.random.programmer <javadesigner@yahoo.com>
To: pgsql-jdbc@postgresql.org
Subject: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)
Date: Mon, 20 Apr 2009 23:15:58 -0700 (PDT)
Message-ID: <171323.40102.qm@web31106.mail.mud.yahoo.com> (raw)
While using JDBC MetaData for my O/R tool, I've come across this
bug recently;
---------------- Background -------------------
Postgres version: 8.3.3
JDBC driver version: 8.3-604 JDBC 3
test=# \d pg_ts_dict;
Table "pg_catalog.pg_ts_dict"
Column | Type | Modifiers
----------------+------+-----------
dictname | name | not null
dictnamespace | oid | not null
dictowner | oid | not null
dicttemplate | oid | not null
dictinitoption | text |
Indexes:
"pg_ts_dict_dictname_index" UNIQUE, btree (dictname, dictnamespace)
"pg_ts_dict_oid_index" UNIQUE, btree (oid)
---------------------JDBC MetaData bug -------------------
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.
Of course, it's possible that JDBC is not supposed to work
with pg_* tables (system space?) but as of now, this is
severely breaking my O/R tool.
--j
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: javadesigner@yahoo.com
Subject: Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)
In-Reply-To: <171323.40102.qm@web31106.mail.mud.yahoo.com>
References: <171323.40102.qm@web31106.mail.mud.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox