From: | "j(dot)random(dot)programmer" <javadesigner(at)yahoo(dot)com> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION) |
Date: | 2009-04-21 06:15:58 |
Message-ID: | 171323.40102.qm@web31106.mail.mud.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Kris Jurka | 2009-04-21 06:37:04 | Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION) |
Previous Message | Kris Jurka | 2009-04-20 21:51:27 | Re: Query preparation |