X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 68A2DD1B787 for ; Tue, 3 Aug 2004 16:47:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 50645-10 for ; Tue, 3 Aug 2004 19:43:00 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 91529D1CB7A for ; Tue, 3 Aug 2004 14:18:25 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i73HIPqb043421 for ; Tue, 3 Aug 2004 17:18:25 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i73GoT2e038924 for pgsql-jdbc@postgresql.org; Tue, 3 Aug 2004 16:50:29 GMT From: "Mike Martin" X-Newsgroups: comp.databases.postgresql.interfaces.jdbc Subject: Re: Wrong column names in ResultSetMetaData Date: Tue, 3 Aug 2004 11:48:30 -0500 Organization: Vieo, Inc. Lines: 27 Message-ID: References: <41086EF8.7010101@opencloud.com> <410ED4E6.8020806@opencloud.com> <410EDF4D.6060808@opencloud.com> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 To: pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.9 tagged_above=0.0 required=5.0 tests=NO_DNS_FOR_FROM, PRIORITY_NO_NAME X-Spam-Level: * X-Archive-Number: 200408/23 X-Sequence-Number: 10745 Kris Jurka: > I believe we agree that for consistency's sake we should return the table > alias (if any) in getTableName. How could we do that, and what would the > purpose be? CREATE TABLE person ( id int4 primary key, parent_id int4 references person (id), name varchar(50) ) SELECT * FROM person inner join person parent on person.parent_id = parent.id rs.getTableName() distinguishes person.name from parent.name. In my experience, drivers correctly implement getTableName() *far* less frequently. I've never been able to rely on it. Of the drivers I have handy, only DB2J and MySQL get it right. Cloudscape, Firebird, hsqldb, mssqlserver, and pg75 all return the underlying base table name. JTDS, Oracle, and pg74 all return empty strings! Mike