X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id CC0099FB381 for ; Fri, 22 Sep 2006 03:13:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 33170-05 for ; Fri, 22 Sep 2006 06:13:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.utiba.com.au (eth2643.vic.adsl.internode.on.net [150.101.158.82]) by postgresql.org (Postfix) with ESMTP id DCEB79FB3EB for ; Fri, 22 Sep 2006 03:04:35 -0300 (ADT) Received: from localhost (scan1.utiba.com.au [127.0.0.1]) by mail.utiba.com.au (Postfix) with ESMTP id 7D72A444C0; Fri, 22 Sep 2006 16:04:34 +1000 (EST) Received: from mail.utiba.com.au ([127.0.0.1]) by localhost (scan1.utiba.com.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 25249-04; Fri, 22 Sep 2006 16:04:28 +1000 (EST) Received: from [192.168.0.49] (pc49.utiba.melb [192.168.0.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.utiba.com.au (Postfix) with ESMTP id 7400F444BB; Fri, 22 Sep 2006 16:04:28 +1000 (EST) Message-ID: <45137CF4.7030202@utiba.com> Date: Fri, 22 Sep 2006 16:04:36 +1000 From: Philip Yarra User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Oliver Jowett Cc: Alex Stienstra , pgsql-jdbc@postgresql.org Subject: Re: ResultSetMetaData.getTableName() == null References: <20060921121816.9wvu8sr34w5c4848@webmail.versatel.nl> <45133DE5.4030100@utiba.com> <451354B5.2070701@opencloud.com> <45135D9B.50500@utiba.com> <45135EE2.6020507@opencloud.com> <4513727F.10107@utiba.com> <45137742.9050600@opencloud.com> In-Reply-To: <45137742.9050600@opencloud.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at utiba.com.au X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/93 X-Sequence-Number: 15811 Oliver Jowett wrote: > Philip Yarra wrote: > So your suggested implementation would return incorrect information > whenever there were aliases involved. Thanks, I understand now. So the decision was to return nothing, rather than something that's potentially wrong? > We have no way of telling if aliasing has been done or not based on the > data returned by the server, so we can't even do it only when no aliases > are used. Looks like Sybase came to the same question and decided that returning the base table name was ok: $ java -cp .:/home/philip/bin/jconn3.jar rsmd sybase3.prop 2006-09-22T15:50:39.206:QUERY: SELECT * FROM tempextest 2006-09-22T15:50:39.210:table name [tempextest] 2006-09-22T15:50:39.212:QUERY: SELECT * FROM tempextest tablealias 2006-09-22T15:50:39.215:table name [tempextest] Oracle seems to have a very similar implementation to PostgreSQL: $ java -cp .:/home/philip/bin/ojdbc14.jar rsmd oracle.prop 2006-09-22T15:53:59.882:QUERY: SELECT * FROM tempextest 2006-09-22T15:53:59.986:empty table name 2006-09-22T15:53:59.987:table name [] 2006-09-22T15:53:59.989:QUERY: SELECT * FROM tempextest tablealias 2006-09-22T15:54:00.3:empty table name 2006-09-22T15:54:00.4:table name [] How about allowing the user to set a connection property so that the (possibly-wrong-but-more-useful) call through to getbaseTablename is done, so that *some* info comes back, with default of existing behaviour? Or has that also been discussed and dismissed previously? :-) Regards, Philip. -- Philip Yarra Senior Software Engineer, Utiba Pty Ltd philip@utiba.com