pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mike Martin <mmartin@vieo.com>
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Wrong column names in ResultSetMetaData
Date: Wed, 4 Aug 2004 17:58:32 -0500
Message-ID: <002101c47a76$90a77640$fe0f010a@MMARTIN1> (raw)
References: <ce9dna$pne$1@news.hub.org>
	<ce9jk0$15mb$1@news.hub.org>
	<41086EF8.7010101@opencloud.com>
	<celqa5$i2c$1@news.hub.org>
	<Pine.BSO.4.56.0408021308010.29090@leary.csoft.net>
	<cembfp$1tpn$1@news.hub.org>
	<Pine.BSO.4.56.0408021705100.21355@leary.csoft.net>
	<410ED4E6.8020806@opencloud.com>
	<Pine.BSO.4.56.0408021925430.5931@leary.csoft.net>
	<410EDF4D.6060808@opencloud.com>
	<Pine.BSO.4.56.0408030045360.19025@leary.csoft.net>
	<ceofog$15o1$1@news.hub.org>
	<Pine.BSO.4.56.0408041433030.7043@leary.csoft.net>

Kris wrote:
> On Tue, 3 Aug 2004, Mike Martin wrote:
>
> > SELECT * FROM person inner join person parent on person.parent_id =
> > parent.id
> >
> > rs.getTableName() distinguishes person.name from parent.name.
> >
> > In my experience, drivers correctly implement getTableName()
> > *far* less frequently.  I've never been able to rely on it.
> >
> > Of the drivers I have handy, only DB2J and MySQL get it right.
> > Cloudscape, Firebird, hsqldb, mssqlserver, and pg75 all return
> > the underlying base table name.  JTDS, Oracle, and pg74 all
> > return empty strings!
>
> You seem surprised that it would return an empty string, while that was
> what I was planning on making it do.  Why should it return the base table
> name when it can't determine if it has been aliased?  Isn't this returning
> incorrect information?

You're right, that exclamation point is undeserved.

Based on the description of getTableName() (and getSchemaName()
and getCatalogName()) I would think a driver should either
return the correct information or "" if not available.

Mike




view thread (27+ messages)  latest in thread

Message-ID: <002101c47a76$90a77640$fe0f010a@MMARTIN1>
Permalink:  ../002101c47a76$90a77640$fe0f010a@MMARTIN1/
Also on:    postgresql.org/message-id/002101c47a76$90a77640$fe0f010a@MMARTIN1

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mmartin@vieo.com, books@ejurka.com
  Subject: Re: Wrong column names in ResultSetMetaData
  In-Reply-To: <002101c47a76$90a77640$fe0f010a@MMARTIN1>
  References: <ce9dna$pne$1@news.hub.org> <ce9jk0$15mb$1@news.hub.org> <41086EF8.7010101@opencloud.com> <celqa5$i2c$1@news.hub.org> <Pine.BSO.4.56.0408021308010.29090@leary.csoft.net> <cembfp$1tpn$1@news.hub.org> <Pine.BSO.4.56.0408021705100.21355@leary.csoft.net> <410ED4E6.8020806@opencloud.com> <Pine.BSO.4.56.0408021925430.5931@leary.csoft.net> <410EDF4D.6060808@opencloud.com> <Pine.BSO.4.56.0408030045360.19025@leary.csoft.net> <ceofog$15o1$1@news.hub.org> <Pine.BSO.4.56.0408041433030.7043@leary.csoft.net> <002101c47a76$90a77640$fe0f010a@MMARTIN1>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox