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 05E65D1B17A for ; Wed, 4 Aug 2004 19:56:14 -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 04706-08 for ; Wed, 4 Aug 2004 22:56:12 +0000 (GMT) Received: from vieo.com (vieo.vieo.com [207.235.47.3]) by svr1.postgresql.org (Postfix) with ESMTP id 6241FD1B1DF for ; Wed, 4 Aug 2004 19:55:59 -0300 (ADT) Received: (from root@localhost) by vieo.com (8.11.2/8.11.2) id i74Mtqp87287 for pgsql-jdbc@postgresql.org; Wed, 4 Aug 2004 17:55:52 -0500 (CDT) (envelope-from mmartin@vieo.com) Received: from MMARTIN1 (dhcp-10-1-15-254.vieo.com [10.1.15.254]) by vieo.com (8.11.2/8.11.2) with SMTP id i74MtnM87147; Wed, 4 Aug 2004 17:55:49 -0500 (CDT) (envelope-from mmartin@vieo.com) Message-ID: <002101c47a76$90a77640$fe0f010a@MMARTIN1> From: "Mike Martin" To: "Kris Jurka" Cc: References: <41086EF8.7010101@opencloud.com> <410ED4E6.8020806@opencloud.com> <410EDF4D.6060808@opencloud.com> Subject: Re: Wrong column names in ResultSetMetaData Date: Wed, 4 Aug 2004 17:58:32 -0500 Organization: Vieo, Inc. MIME-Version: 1.0 X-scanner: scanned by Inflex 1.0.10 - (http://pldaniels.com/inflex/) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/30 X-Sequence-Number: 10752 Kris wrote: > On Tue, 3 Aug 2004, Mike Martin wrote: > > > 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! > > You seem surprised that it would return an empty string, while that was > what I was planning on making it do. Why should it return the base table > name when it can't determine if it has been aliased? Isn't this returning > incorrect information? You're right, that exclamation point is undeserved. Based on the description of getTableName() (and getSchemaName() and getCatalogName()) I would think a driver should either return the correct information or "" if not available. Mike