Re: Support for DatabaseMetadata: getCatalogName, getTableName,

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Support for DatabaseMetadata: getCatalogName, getTableName,
Дата
Msg-id 10251.1167974932@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Support for DatabaseMetadata: getCatalogName, getTableName,  (Ken Johanson <pg-user@kensystem.com>)
Ответы Re: Support for DatabaseMetadata: getCatalogName, getTableName,  (Ken Johanson <pg-user@kensystem.com>)
Список pgsql-jdbc
Ken Johanson <pg-user@kensystem.com> writes:
> Kris Jurka wrote:
>> The previous discussion I cited was referring to getColumnName and how
>> it really should be referring to the alias of a result, not the column
>> itself.  That is for "SELECT a AS b FROM c AS d" should return "b" for
>> getColumnName(1).  If we accept that as true then it follows that
>> getTableName(1) should return "d", not "c".

> Understood now, thanks. I agree/vote this is the best spec
> interpretation/behavior (for its lack of a 'getTableLabel').

Urm ... I might agree with that, except for its signal lack of usefulness.
What is the point of knowing the table alias?  The
underlying-table-and-column names have some possible usefulness for
issuing updates against the underlying tables, but what the heck are you
going to do with "d" here?  If the application understands the query
(which it itself issued, don't forget) well enough to understand what
"d" conveys, why wouldn't "b" be at least as useful?

I think you're letting a narrow reading of some admittedly-badly-written
spec text get the best of you.

            regards, tom lane

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: sbaskar
Дата:
Сообщение: PgSQL Monitoring( Please let me know the table details )
Следующее
От: Ken Johanson
Дата:
Сообщение: Re: Support for DatabaseMetadata: getCatalogName, getTableName,