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