Re: ResultSetMetaData enhancements

Lists: pgsql-jdbc
From: ow <oneway_111(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSetMetaData enhancements
Date: 2004-07-12 22:59:47
Message-ID: 20040712225947.85618.qmail@web53909.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Is this going to be in 7.5? Thanks

> On Tuesday 30 December 2003 10:01 am, Kris Jurka wrote:
> > This patch is the culmination of Jan-Andre's work on enhancing the
> > ResultSetMetaData methods with new information available in the V3
> > protocol. He wandered off of the verge of completing it and I've just
> > done some minor reworking and editing.
> >
> > This implements getSchemaName, getTableName, getColumnName,
> > getColumnLabel, and isNullable.
> >
> > Kris Jurka


__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail


From: Kris Jurka <books(at)ejurka(dot)com>
To: ow <oneway_111(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSetMetaData enhancements
Date: 2004-07-12 23:19:02
Message-ID: Pine.BSO.4.56.0407121817560.20685@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Mon, 12 Jul 2004, ow wrote:

> Is this going to be in 7.5? Thanks
>

Yes. You can try it out now with the 7.5dev drivers available from
http://jdbc.postgresql.org/download.html.

Kris Jurka


From: ow <oneway_111(at)yahoo(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSetMetaData enhancements
Date: 2004-07-12 23:47:35
Message-ID: 20040712234735.71375.qmail@web53903.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Does the 7.5 driver require server upgrade to 7.5? Thanks

--- Kris Jurka <books(at)ejurka(dot)com> wrote:
> Yes. You can try it out now with the 7.5dev drivers available from
> http://jdbc.postgresql.org/download.html.
>
> Kris Jurka


__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail


From: Kris Jurka <books(at)ejurka(dot)com>
To: ow <oneway_111(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSetMetaData enhancements
Date: 2004-07-13 00:09:47
Message-ID: Pine.BSO.4.56.0407121908410.9364@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Mon, 12 Jul 2004, ow wrote:

> Does the 7.5 driver require server upgrade to 7.5? Thanks
>

No. I've tested it for all versions going back to 7.2. Although if you
want to use this feature you need at least a 7.4 server because it
requires using the new V3 protocol.

Kris Jurka


From: ow <oneway_111(at)yahoo(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSetMetaData enhancements
Date: 2004-07-13 03:58:39
Message-ID: 20040713035839.66212.qmail@web53910.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Hi,

Yes, rsmd.getTableName() appears to work. However, I was under impression that
the folowing should also work (but it does not):

someValue = rs.getXXX("table.column"); // instead of just rs.getXXX("column")

This would be usefull if result set contained two columns from different tables
with the same name.

Am I wrong on that one? Thanks

--- Kris Jurka <books(at)ejurka(dot)com> wrote:
> No. I've tested it for all versions going back to 7.2. Although if you
> want to use this feature you need at least a 7.4 server because it
> requires using the new V3 protocol.
>
> Kris Jurka


__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail


From: Kris Jurka <books(at)ejurka(dot)com>
To: ow <oneway_111(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSetMetaData enhancements
Date: 2004-07-13 04:30:55
Message-ID: Pine.BSO.4.56.0407122322440.17993@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Mon, 12 Jul 2004, ow wrote:

> Yes, rsmd.getTableName() appears to work. However, I was under
> impression that the folowing should also work (but it does not):
>
> someValue = rs.getXXX("table.column"); // instead of just rs.getXXX("column")
>
> This would be usefull if result set contained two columns from different
> tables with the same name.
>

It actually isn't rs.getXXX("column"), it's the alias given to a select
output. Note that "SELECT a AS b FROM tab" will need to use
rs.getXXX("b"), not "a". There are some rules for coming up with a
default alias which make the column name the alias for plain
columns without aliases.

Adding the tablename to the getXXX method doesn't seem any cleaner to me
than providing a select alias for the column and actually would have some
implementation issues. Notably column names are allowed to have a . in
them, so how would you know when someone was providing a table name.

Kris Jurka