rs.getMetaData.getTableName always return empty string

Started by nowind_leeabout 14 years ago2 messagesbugs
Jump to latest
#1nowind_lee
nowind_lee@qq.com

I've read some discussions before I write this post. I know that "rs.getMetaData.getTableName" always return empty string just because the developers think it should be alias name in the query, not the underlying table name, which is hard to implement, so it's best to leave it blank.

And also there is a "PGResultSetMetaData.getBaseTableName()" can be used to get the table name.

I understand this, but it make something very hard. Please see my question:

http://stackoverflow.com/questions/9247064/play2s-anorm-cant-work-on-postgresql

From the implementation of play's anorm framework, we know that most of other jdbc drivers all return the underlying table name in "rs.getMetaData.getTableName". It make the parse of result set of "join" query easily.

Since all other drivers have the same action, will postgresql driver do it too? I think return the underlying table name is much more useful than an empty string.

#2Robert Haas
robertmhaas@gmail.com
In reply to: nowind_lee (#1)
Re: rs.getMetaData.getTableName always return empty string

On Sun, Feb 12, 2012 at 11:42 AM, nowind_lee <nowind_lee@qq.com> wrote:

I've read some discussions before I write this post. I know that
"rs.getMetaData.getTableName" always return empty string just because the
developers think it should be alias name in the query, not the underlying
table name, which is hard to implement, so it's best to leave it blank.

And also there is a "PGResultSetMetaData.getBaseTableName()" can be used to
get the table name.

I understand this, but it make something very hard. Please see my question:

http://stackoverflow.com/questions/9247064/play2s-anorm-cant-work-on-postgresql

From the implementation of play's anorm framework, we know that most of
other jdbc drivers all return the underlying table name in
"rs.getMetaData.getTableName". It make the parse of result set of "join"
query easily.

Since all other drivers have the same action, will postgresql driver do it
too? I think return the underlying table name is much more useful than an
empty string.

I think you might want to post this question to the pgsql-jdbc mailing
list, rather than here.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company