Unix Technical Forum

Re: ResultSetMetaData.getTableName() == null

This is a discussion on Re: ResultSetMetaData.getTableName() == null within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> MySQL returns the tablename if possible otherwise the alias. I find this an acceptable solution. Having at least a ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2008, 12:18 AM
Alex Stienstra
 
Posts: n/a
Default Re: ResultSetMetaData.getTableName() == null

MySQL returns the tablename if possible otherwise the alias. I find
this an acceptable solution. Having at least a name one could query the
meta system in other to determine whether it is a table name or not.

I am working on automatically generated web interface on the basis of a
single SQL query. This is why I need to know the columns and tables
involved in the query: http://www.melstra.nl/test/Form1.php

Best regards,

Alex Stienstra.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-16-2008, 12:18 AM
Markus Schaber
 
Posts: n/a
Default Re: ResultSetMetaData.getTableName() == null

Hi, Alex,

Alex Stienstra wrote:
> MySQL returns the tablename if possible otherwise the alias. I find this
> an acceptable solution. Having at least a name one could query the meta
> system in other to determine whether it is a table name or not.


The problem is that PostgreSQL does not pass any information about
aliases down to the client.

So we have two possibilities to implement this feature: Hack up the
server to provide that additional info, or implement a fully-fledged SQL
parser in the client and get the alias names ourselves.

Both seems not worth it currently.

HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-16-2008, 12:18 AM
Dave Cramer
 
Posts: n/a
Default Re: ResultSetMetaData.getTableName() == null


On 22-Sep-06, at 9:23 AM, Markus Schaber wrote:

> Hi, Alex,
>
> Alex Stienstra wrote:
>> MySQL returns the tablename if possible otherwise the alias. I
>> find this
>> an acceptable solution. Having at least a name one could query the
>> meta
>> system in other to determine whether it is a table name or not.

>
> The problem is that PostgreSQL does not pass any information about
> aliases down to the client.
>
> So we have two possibilities to implement this feature: Hack up the
> server to provide that additional info, or implement a fully-
> fledged SQL
> parser in the client and get the alias names ourselves.

Certainly parsing the SQL is expensive, however I would like to see
the server extend the protocol to give us this information.

Dave
>
> Both seems not worth it currently.
>
> HTH,
> Markus
> --
> Markus Schaber | Logical Tracking&Tracing International AG
> Dipl. Inf. | Software Development GIS
>
> Fight against software patents in Europe! www.ffii.org
> www.nosoftwarepatents.org
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that
> your
> message can get through to the mailing list cleanly
>



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-16-2008, 12:18 AM
Alex Stienstra
 
Posts: n/a
Default Re: ResultSetMetaData.getTableName() == null

Hi Markus,

I'am surprised that PostgreSQL doesn't pass the table informatie to the
client. Susprised, since for example the library PHP (pg_field_table) is
using, does pass on this information. I'am quite sure that this library
function is based on the same API as the JDBC implementation is.

I agree with you that PostgreSQL server should supply this information
and implementing a full-flegded SQL parser is no option. Specially,
because PostgreSQL already parses the statement and therefore knows the
tables and columns that are involved in the query.

It is a pitty that this (for me) vital information is not made
available.

Best regards,

Alex.

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailtogsql-jdbc-owner@postgresql.org] On Behalf Of Markus Schaber
Sent: vrijdag 22 september 2006 15:24
To: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] ResultSetMetaData.getTableName() == null


Hi, Alex,

Alex Stienstra wrote:
> MySQL returns the tablename if possible otherwise the alias. I find
> this an acceptable solution. Having at least a name one could query
> the meta system in other to determine whether it is a table name or
> not.


The problem is that PostgreSQL does not pass any information about
aliases down to the client.

So we have two possibilities to implement this feature: Hack up the
server to provide that additional info, or implement a fully-fledged SQL
parser in the client and get the alias names ourselves.

Both seems not worth it currently.

HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:31 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com