Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)

From: "j(dot)random(dot)programmer" <javadesigner(at)yahoo(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>, Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)
Date: 2009-04-21 07:19:23
Message-ID: 376519.84637.qm@web31105.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


Kris, Oliver:

Thanks for the quick replies.

Just to recap, this is on postgres 8.3.3 and JDBC3 8.3-604.

Using your exact program Kris, I get duplicate entries for ALL columns, when I run it on my machine.

Here is the output
-----------------------------------------------------------
root(at)turing:/tmp# java MDts

TABLE_CAT, TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, DATA_TYPE, TYPE_NAME, COLUMN_SIZE, BUFFER_LENGTH, DECIMAL_DIGITS, NUM_PREC_RADIX, NULLABLE, REMARKS, COLUMN_DEF, SQL_DATA_TYPE, SQL_DATETIME_SUB, CHAR_OCTET_LENGTH, ORDINAL_POSITION, IS_NULLABLE, SCOPE_CATLOG, SCOPE_SCHEMA, SCOPE_TABLE, SOURCE_DATA_TYPE
null, pg_catalog, pg_ts_dict, dictname, 12, name, 2147483647, null, 0, 10, 0, null, null, null, null, 2147483647, 1, NO, null, null, null, null
null, pg_catalog, pg_ts_dict, dictnamespace, -5, oid, 10, null, 0, 10, 0, null, null, null, null, 10, 2, NO, null, null, null, null
null, pg_catalog, pg_ts_dict, dictowner, -5, oid, 10, null, 0, 10, 0, null, null, null, null, 10, 3, NO, null, null, null, null
null, pg_catalog, pg_ts_dict, dicttemplate, -5, oid, 10, null, 0, 10, 0, null, null, null, null, 10, 4, NO, null, null, null, null
null, pg_catalog, pg_ts_dict, dictinitoption, 12, text, 2147483647, null, 0, 10, 1, null, null, null, null, 2147483647, 5, YES, null, null, null, null
null, public, pg_ts_dict, dict_name, 12, text, 2147483647, null, 0, 10, 0, null, null, null, null, 2147483647, 1, NO, null, null, null, null
null, public, pg_ts_dict, dict_init, 1111, regprocedure, 2147483647, null, 0, 10, 1, null, null, null, null, 2147483647, 2, YES, null, null, null, null
null, public, pg_ts_dict, dict_initoption, 12, text, 2147483647, null, 0, 10, 1, null, null, null, null, 2147483647, 3, YES, null, null, null, null
null, public, pg_ts_dict, dict_lexize, 1111, regprocedure, 2147483647, null, 0, 10, 0, null, null, null, null, 2147483647, 4, NO, null, null, null, null
null, public, pg_ts_dict, dict_comment, 12, text, 2147483647, null, 0, 10, 1, null, null, null, null, 2147483647, 5, YES, null, null, null, null
-------------------------------------------------------

Note, the ORDINAL_POSITION, 6th column from the end, is
repeated for each column. For example, see dictname and
dict_name. This is exactly the problem my O/R tool is
also facing.

Also, on my machine, there only seems to be one pg_ts_dict
table and no other table with that pattern.

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)

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)

test=# \d pgtsdict;
Did not find any relation named "pgtsdict".
test=# \d pg_tsdict;
Did not find any relation named "pg_tsdict".
test=# \d pgts_dict;
Did not find any relation named "pgts_dict".

Dunno what is causing this, especially since you said
you didn't see these duplicates on your machine. Maybe
you are running something later than postgres 8.3.3 ?

Best regards,
--j

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2009-04-21 07:26:00 Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)
Previous Message Kris Jurka 2009-04-21 07:07:31 Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION)