Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 040E56326D9 for ; Tue, 21 Apr 2009 04:19:28 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 78501-06 for ; Tue, 21 Apr 2009 04:19:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from web31105.mail.mud.yahoo.com (web31105.mail.mud.yahoo.com [68.142.200.38]) by mail.postgresql.org (Postfix) with SMTP id 5CE646326EF for ; Tue, 21 Apr 2009 04:19:25 -0300 (ADT) Received: (qmail 85003 invoked by uid 60001); 21 Apr 2009 07:19:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1240298364; bh=EZr3tq30n/ZPFv4Ic9LctXhns59/U2wIpSXi2ykMDKw=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type; b=H9Kpm4eQERZjZH0ACI3AJfuC1+ROGPO8v3U82rNk1fWBX29eQRTok5rOdyDBGg1JmkmFppctWBlRMEBnxtscHDtSG31Y/3SjlL6RujYDZYD42WvM0SC7+SdQOahxi8bTl9jEWWcxOI11oRL/rxRY/EGEFBPoxxSKBSmFbWGR3ys= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type; b=oTpLrAphqq2uIhkLkMOVrx/lxBz4oVliibYwQQ49Q1OWgbHsK22sQRoTNGOCy+HmKitGqDPyaBrHWuoAaeuaQoMecRJf8aJHMRSYOYUtjU7SpVwwQdoIJINZzHy8pcQ3YujGP/qwnzKVPn3XtvzH7TofFpe3sW8Mcv9wFzx0Dbg=; Message-ID: <376519.84637.qm@web31105.mail.mud.yahoo.com> X-YMail-OSG: THSLfBUVM1nBqt9BQ6mu37gOEVF_bndDwdx7iXnh5PC37K9LRkf3VUhch6FB90rGoezso8QH70noRHUGPMTQbhz0QcOHTXjOYurTDjgCCM6NAugFa2chfAOwESWsYgZdrmHs5nKZ84S8G.NRES38IxZPlvJ4aYVb6fEveGTQbRFck11g5EZos2cgN8GZDNzXKrCroX8YDDkarlslN0afQ0Leior0oiQBeEkONWtHtd9_jNyx7sTLWfigrAxP0dInrmg9OycUPqcJpuz5egWiX4sMJR6w8WUn.7e3pW4ABJ_UtcKN Received: from [216.80.52.8] by web31105.mail.mud.yahoo.com via HTTP; Tue, 21 Apr 2009 00:19:23 PDT X-Mailer: YahooMailClassic/5.2.15 YahooMailWebService/0.7.289.1 Date: Tue, 21 Apr 2009 00:19:23 -0700 (PDT) From: "j.random.programmer" Subject: Re: Bug with duplicate column names via JDBC MetaData (ORDINAL_POSITION) To: Oliver Jowett , Kris Jurka Cc: pgsql-jdbc@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/77 X-Sequence-Number: 19524 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@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