pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mike Martin <mmartin@vieo.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Wrong column names in ResultSetMetaData
Date: Tue, 3 Aug 2004 11:48:30 -0500
Message-ID: <ceofog$15o1$1@news.hub.org> (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>

Kris Jurka:
> I believe we agree that for consistency's sake we should return the table
> alias (if any) in getTableName.  How could we do that, and what would the
> purpose be?

CREATE TABLE person (
    id int4 primary key,
    parent_id int4 references person (id),
    name varchar(50)
)

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!

Mike





view thread (27+ messages)  latest in thread

Message-ID: <ceofog$15o1$1@news.hub.org>
Permalink:  ../ceofog$15o1$1@news.hub.org/
Also on:    postgresql.org/message-id/ceofog$15o1$1@news.hub.org

 · 

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
  Subject: Re: Wrong column names in ResultSetMetaData
  In-Reply-To: <ceofog$15o1$1@news.hub.org>
  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>

* 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