Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TT0xN-0002If-IT for pgsql-jdbc@postgresql.org; Tue, 30 Oct 2012 01:49:29 +0000 Received: from mail63.csoft.net ([205.205.214.4]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TT0xG-0005FR-AO for pgsql-jdbc@postgresql.org; Tue, 30 Oct 2012 01:49:29 +0000 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail63.csoft.net (Postfix) with ESMTP id 5611E28423; Mon, 29 Oct 2012 21:49:20 -0400 (EDT) Received: by leary.csoft.net (Postfix, from userid 1112) id 4E2311FBC8; Mon, 29 Oct 2012 22:49:20 -0300 (ADT) Date: Mon, 29 Oct 2012 22:49:20 -0300 (ADT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Goran Popov cc: pgsql-jdbc@postgresql.org Subject: Re: TableName In-Reply-To: <508EA11A.7080104@prokomsoft.rs> Message-ID: References: <508EA11A.7080104@prokomsoft.rs> User-Agent: Alpine 2.00 (BSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Pg-Spam-Score: -2.5 (--) X-Archive-Number: 201210/139 X-Sequence-Number: 23463 On Mon, 29 Oct 2012, Goran Popov wrote: > Whay this is default > public String getTableName(int column) throws SQLException > { > return ""; > } > For symmetry with getColumnName. Currently getColumnName returns the aliased column name so that "SELECT a AS b FROM c AS d" returns "b" for getColumnName. So we'd like to be able to return "d" for getTableName, but do not have sufficient information to do so, so we return "". My recollection of previous discussions was that getColumnName should return "a" and getColumnLabel should return "b". Then getTableName could return "c" without inconsistency. The problem is that a lot of code has been written assuming that getColumnName will return the aliased version, so we'd need a configuration option to determine which behavior to use. This makes it more work than just a straight switchover and is likely the reason this hasn't been done. Kris Jurka