Re: TableName - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: TableName
Date
Msg-id alpine.BSO.2.00.1210292244540.18822@leary.csoft.net
Whole thread Raw
In response to TableName  (Goran Popov <goran.popov@prokomsoft.rs>)
List pgsql-jdbc

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


pgsql-jdbc by date:

Previous
From: Richard Broersma
Date:
Subject: Re: JDBC4 Postgresql Driver
Next
From: dmp
Date:
Subject: Re: TableName