Re: ResultSetMetaData.getTableName() - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: ResultSetMetaData.getTableName()
Date
Msg-id 16346.1006624807@sss.pgh.pa.us
Whole thread Raw
In response to ResultSetMetaData.getTableName()  (Jason Davies <jason@netspade.com>)
Responses Re: ResultSetMetaData.getTableName()  (Jason Davies <jason@netspade.com>)
List pgsql-jdbc
Jason Davies <jason@netspade.com> writes:
> Is there any chance ResultSetMetaData.getTableName(int column) could
> be implemented somehow?

The entire concept seems faulty.  Select results don't come from any
particular table in the general case, and any tool that expects the
special case to apply to general queries is broken by design.

You do, of course, know which table the columns came from if you issue a
query like
        SELECT * FROM foo
but you hardly need the backend to tell you so.  ISTM that no frontend
tool should expect to associate particular table names with SELECT
results except when it knows the query is of such a simple form as this.

            regards, tom lane

pgsql-jdbc by date:

Previous
From: Jason Davies
Date:
Subject: ResultSetMetaData.getTableName()
Next
From: Jason Davies
Date:
Subject: Re: ResultSetMetaData.getTableName()