Re: ResultSetMetaData.getTableName() == null

From: "Alex Stienstra" <Alex(dot)Stienstra(at)zonnet(dot)nl>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: ResultSetMetaData.getTableName() == null
Date: 2006-09-25 18:26:59
Message-ID: 000001c6e0d0$307437a0$8602a8c0@METALEX
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Markus Schaber
Sent: vrijdag 22 september 2006 15:24
To: pgsql-jdbc(at)postgresql(dot)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(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Markus Schaber 2006-09-25 18:59:32 Re: ResultSetMetaData.getTableName() == null
Previous Message Dave Cramer 2006-09-25 17:37:03 Re: Bind message